Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/npag.mic
There are no other files named npag.mic in the archive.
;SPECIAL MICRO-CODE FOR IMPLIMENTING DIAGNOSTIC INSTRUCTIONS FOR
;USE BY THE PAGING DIAGNOSTIC.. INSTRUCTIONS IMPLIMENTED:
;PTWRDT AC,E(OPCODE 00)	;WRITE DATA TO PAGE TABLE
;			;AC CONTAINS DATA TO WRITE(BITS0-35)
;			;E IS PAGE TABLE ADDRESS(BITS 18-26)
;PTREAD AC,E(OPCODE 01)	;READ THE PAGE TABLE DATA VIA EBUS REGISTER
;			;AC RECEIVES RESULTS
;			;E CONTAINS PAGE TABLE ADDRESS TO READ(BITS18-26)
;PTDWRT AC,E(OPCODE 10)	;WRITE DATA TO PAGE TABLE DIRECTORY
;			;AC CONTAINS DATA TO WRITE
;			;E CONTAINS DIRECTORY ADDRESS TO WRITE
;PTDVER AC,E(OPCODE 100);PAGE TABLE DIRECTORY VERIFY
;			;AC CONTAINS DATA TO BE VERIFIED
;			;E CONTAINS DIRECTORY ADDRESS TO BE VERIFIED
;			;IF MATCH VERIFIES,RH OF AC SET TO ZEROES
;			;IF NO MATCH, RH OF AC SET TO ONES
;DISPATCHER TO DESIRED DIAGNOSE INSTRUCTION
	SCAD/A,SCADA/#,#/32.,SC/SCAD,J/EXECTR, ;SHIFT GETS BITS 32-35 TO 0-3
	    SPEC/SP MEM CYCLE		;AND SET "EBOX MAY BE PAGED"

BIT17:	J/VMA17,SKIP/AR18,AD/0S,AR/AD ;NOW CLR AR AND TEST FOR "17"
COMPT:	AR/SH,SH/AR SWAP,	;SET SPECIALS TO "19","20" OF AR
	    DISP/RETURN,J/1	;AND RETURN 1 LOC BEYOND WHERE CALLED

;COMMON SUBROUTINE FOR ALL INSTRUCTIONS WHICH DEAL WITH THE
;PAGE TABLE DIRECTORY.. SUBROUTINE SETS AR BITS 19&20
;TO CORRESPOND TO THE STATES OF "VMA USER"&"VMA BIT17" SO
;THAT THE MAIN INSTRUCTION CAN XOR THE AR REGISTER AGAINST THE
;ADDRESS SUPPLIED IN THE INSTR... THIS IS SO THE INSTR
;WILL ALWAYS ACCESS THE CORRECT DIRECTORY ADDRESS AND NOT
;BE SCREWED BY THE PAGE TABLE XORING THINGS ALL TO HELL..
STXOR:	BR/AR,		;SAVE "E" IN BR FOR PENDING XOR
	    FMADR/AC0,AD/B,ADB/FM,AR/AD, ;DATA INTO AR
	    SPEC/FLAG CTL,FLAG CTL/SET FLAGS ;SET "SCD USER" FOR USERS

	DISP/BYTE,J/USERBT,AD/A+1,ADA/PC,ARX/AD ;PC TO ARX
=01
USERBT:	AR/AD*.25,AD/B,ADB/BR*2, ;IF NO SKIP..NO USER BIT
	    SPEC/SP MEM CYCLE,SP MEM/NO USR W NO PG FAIL,
	    J/BIT17
=11
	SC/SCAD,SCAD/A,SCADA/#,#/200, ;IF HERE, YES USER BIT
	    AR/AD*.25,AD/B,ADB/BR*2 ;SO SET AND CONTINUE
	SPEC/SP MEM CYCLE,SP MEM/USER W NO PG FAIL, ;NOW SET USER
	    J/BIT17	;AND CONTINUE
=0
VMA17:	AR/ARMM,ARMM/SCAD EXP, ;IF HERE, NO "17",JUST LOAD AR
	    SCAD/A+B,SCADA EN/0S,SCADB/SC,  ;GET SPECIAL BITS TO SCADDER
	    COND/LD AR0-8,J/COMPT ;AND THEN TO AR BITS 0-8

	SC/SCAD,SCAD/A+B,SCADB/SC,SCADA/#,#/100, ;SET BIT TO SAY "17"
	    J/VMA17		;AND GO TO LOAD SPECIALS TO AR

EXECTR:	J/XCTGO,DISP/SH0-3,SH/SHIFT AR!ARX, ;DISPATCH TO EXECUTE CODE
	    SC/SCAD,SCADA EN/0S,SCAD/A ;CLEAR SC BEFORE EXECUTE
=0000
XCTGO:
MPTWRDT: ADB/FM,AD/B,AR/AD,FMADR/AC0,J/OP00 ;OPCODE "00"IS PTWRDT
MPTREAD: SPEC/SP MEM CYCLE,
	    SP MEM/PT RD NO PG FAIL,J/OP01 ;OPCODE "01" IS PTREAD


=0
MPTDWRT: J/STXOR,SPEC/CALL, ;FIRST GO SUBRTN TO XORDATA & ADDR
	    AR/AD,AD/OR,ADB/FM,FMADR/AC0,ADA/AR ;BITS 13-17 ORED WITH 18-35

;RETURN FROM SUBROUTINE WILL FALL HERE...THERFORE OPCODE 11 MUST REMAIN
;UNUSED..THIS SAVES A JUMP MICRO INSTR..
	AD/XOR,ADA/AR,ADB/BR, ;ACTUALLY PERFORM THE "XOR"
	    VMA/AD,MEM/REG FUNC, ;AND LOAD VMA 13-35 WITH DATA&ADR
	    J/OP10,		 ;SET UP AR WITH PC & GO ON
	MREG FNC/NO MEM ACCESS ;"APR READ REG" & "APR LOAD REG"TO KILL MEM CYC

;OPCODE 100 IS PAGE TABLE DIRECTORY VERIFY INSTR..
MPTDVER: J/STXOR,SPEC/CALL,	;FIRST GO TO SUBRTN TO XOR DATA & ADDR
	    AR/AD,AD/OR,ADB/FM,FMADR/AC0,ADA/AR ;BITS 13-17 ORED WITH 18-35

;RETURN FROM SUBROUTINE WILL FALL HERE... THEREFORE OPCODE 101 MUST
;REMAIN UNUSED.. THIS SAVES A JUMP MICRO INSTR
	MEM/REG FUNC,VMA/AD,MREG FNC/VER PTD, ;START MEMORY ACCESS
	    AD/XOR,ADA/AR,ADB/BR, ;AND ACTUALLY DO THE XOR
	    J/OP101,AR/AD ;AND FINISH INSTR & SET "APR READ & LOAD ERA"

;OPCODES CONTINUED......110,111
;PAIRED SKIP LOCATIONS FOR DECIDING IF A PAGE TABLE
;DIRECTORY VERIFY HAS COME UP WITH A MATCH, OR NO MATCH
=0111
MATCH:	AD/B,ADB/FM,FMADR/AC0,	;IF MATCH, GET ORIGINAL DATA
	    COND/ARL IND,CLR/ARR,ARL/AD, ;AND CLR RIGHT HALF OF AC
	    J/NORMEND		;TAKE NORMAL EXIT

2377:
NOMTCH:	AR/AD,AD/1S,COND/ARL IND,ARL/ARL, ;IF NO MATCH SET 1S TO RIGHT HALF
	    J/NORMEND		;TAKE NORMAL EXIT
;PTWRDT INSTRUCTION CONTINUED
2370:
OP00:	COND/MBOX CTL,MBOX CTL/PT WR, ;WRITE DATA TO PAGE TABLE
	    ADA/PC,AD/A+1,AR/AD,VMA/AD, ;AND UPDATED PC TO AR
	    J/0000

;PTREAD INSTRUCTION CONTINUED
2371:
OP01:	MEM/REG FUNC,MREG FNC/READ PT ;START MEM CYCLE TO FORCE PT INTO EBUS REG
2372:
	MEM/MB WAIT,COND/DIAG FUNC, ;WAIT FOR CYCLE TO COMPLETE
	    DIAG FUNC/RD EBUS REG,AR/EBUS ;& EBUS REG INTO "AR"
2373:
NORMEND: FMADR/AC0, COND/FM WRITE,AR/AD,AD/A+1,
	    ADA/PC,VMA/AD,J/OFFUSR ;AND ON TO NEXT INSTR
2374:
OP10:	COND/MBOX CTL,MBOX CTL/PT DIR WR, ;WRITE P.T. DIRECTORY
	    AR/AD,AD/A+1,ADA/PC,VMA/AD, ;NEXT PC
	    J/OFFUSR	;AND BACK TO INSTR STREAM

2375:
OP101:	COND/MBOX CTL,MBOX CTL/SET PAGE FAIL, ;NOW FORCE PAGE FAIL
	    ADB/FM,AD/B,FMADR/AC0, ;GET ORIGINAL DATA TO AR
	    J/0000		;AND WAIT FOR THE  PAGE FAIL TO "1777"
2346:
OFFUSR:	SPEC/FLAG CTL,J/DAMMIT	;CLEAR "SCD USER"
2357:
DAMMIT:	COND/ARL IND,CLR/ARL,AR/AD,ADA/AR, ;CLR LEFT HALF AC
	    J/0000			;AND BACK TO MAINLINE
;INITIALIZE THE VMA TO PREVENT AC REFS
;ACTUAL MICRO-CODE USED FOR CACHE TO IR DATA LINE TEST
2366:
INIC2IR: COND/DIAG FUNC,AD/A,ADA/AR,	;MUST FIRST SET KL MODE
	    DIAG FUNC/CONO PAG,VMA/AD	;AND TRAP EN.& LOAD VMA
2376:
CSH2IR:	MEM/REG FUNC,MREG FNC/READ ERA, ;START MBOX CYCLING
	    COND/LOAD IR,AD/0S ;AND CLEAR IR
2351:	TIME/5T			;EBOX WILL WAIT FOR MBOX
2355:	COND/LOAD IR,ADA/AR,AD/SETCA, ;AFTER MBOX RESP.LOAD IR
	    TIME/5T
2356:	TIME/2T,J/CSH2IR	; AND BACK TO BEGINNING

;AND NEW PAGE FAIL  INSTR
1777:	J/MATCH,DISP/PG FAIL,TIME/5T	;DISPATCH ON PAGE FAILS