Trailing-Edge
-
PDP-10 Archives
-
cuspmar86binsrc_1of2_bb-x128b-sb
-
10,7/bootm/dxld.mac
There are 6 other files named dxld.mac in the archive. Click here to see a list.
TITLE DXLD DX10 AND DX20 MICRO-CODE BOOTSRAP LOADER
SUBTTL T.HESS/TAH/TW 9 AUG 85
SALL
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1986.
;ALL RIGHTS RESERVED.
;ASSEMBLY SWITCHES
IFNDEF DX20,<DX20==1> ;NON-0 TO LOAD THE DX20 AS WELL AS THE DX10
;ASSIGNMENTS
IOCLR==1B19 ;APR, I/O CLR
PICLR==10400 ;PI SYSTEM CLEAR
DTE==200 ;DEVICE CODE
;VERSION NUMBER
VDXLD==2 ;VERSION #
EDXLD==10 ;EDIT #
PDXLD==0 ;PATCH LEVEL
WDXLD==0 ;LAST EDITED BY DEC
LOC 137
BYTE (3)WDXLD(9)VDXLD(6)PDXLD(18)EDXLD
;MAGIC ADR AND VALUE DEFINITION
MAGICA==11 ;ADDRESS THAT THE STANDALONE AND
; USER MODE BOOTSTRAPS MUST PUT A
; MAGIC VALUE IN AS THE MONITOR CHECKS
; THE MAGIC VALUE DURING INITIALIZATION.
MAGICV==42562 ;THE MAGIC VALUE
DEFINE WARNCR (STRING)<
XLIST
PUSHJ P,[OUTSTR [ASCIZ \% STRING
\]
RETURN]
LIST >
DEFINE ERROR (STRING)<
XLIST
JRST [OUTSTR [ASCIZ \? STRING
\]
EXIT]
LIST>
DEFINE RETURN <
XLIST
POPJ P,
LIST>
DEFINE PREWT(X)
<SETZ T2, ;;SET T2 TO 0
MOVEI T3,X ;;GET REGISTER NUMBER IN T3
>;END OF PREWT
;DX10 VALUES
PDC==220 ;DEVICE CODE
RUNIND==1 ;RUN FLAG
INHLD==1B25 ;INHIBIT LOAD ICPC
MPERR=1B26 ;MICRO-PROCESSOR ERROR
MEMPAR==1B27 ;MEM PAR ERROR
NXM==1B28 ;NXM
STAVL==1B29 ;STATUS AVAIL
CONT==1B32 ;CONTINUE DX10
DXCLR==2 ;CLEAR DX10
UNITNM==7713 ;ADDRESS OF UNIT IN 8-MEM
ENEXM==1B22 ;ENABLE EXAMINE
ENDEP==1B23 ;ENABLE DEPOSIT
RSEL==1
MPADR==5
MPCTL==4
;AC'S
T1=1
T2=2
T3=3
T4=4
P1=5
P2=6
WC==7
P=17 ;PUSH DOWN PNTR
SUBTTL EXEC-MODE LOAD MICRO
LOC 200
PLIST: BLOCK 20
;THIS CODE WILL BE READ-IN BY THE TU70 MAGTAPE SYSTEM
;BY THE READ-IN HARDWARE STARTING AT LOCATION 0
;AND THEN WILL BE STARTED AT LOCATION 100.
LOC 220 ;CODE WILL EVENTUALLY BE TRANSFERRED TO HERE
CONIX: CONI PDC,0 ;CONI INSTRUCTION
CONOX: CONO PDC,CONT ;CONO TO SET CONTINUE
DATAIX: DATAI PDC,0 ;DATAI INSTRUCTION
DATAOX: DATAO PDC,0 ;DATAO INSTRUCTION
CONOP: POINT 7,CONOX,9 ;POINTER TO CONO DEVICE CODE
DATAIP: POINT 7,DATAIX,9 ;POINTER TO DATAI DEVICE CODE
DATAOP: POINT 7,DATAOX,9 ;POINTER TO DATAO DEVICE CODE
MEM8P: POINT 12,MEM8 ;POINTER TO PDP-8A CORE IMAGE
RECDS: BLOCK 1 ;RECORDS TO READ FROM TAPE
STRTAD: BOOTM## ;BOOTM START ADDRESS
LOCATE: MEM8 ;START LOADING HERE
PHASE 77 ;CODE EXECUTED AT 100 STARTS HERE
POINTR: XWD <READIN-<LOCATE-CONIX+2>>,CONIX;BLT POINTER
READIN: MOVE POINTR ;GET POINTER
BLT ENDIN ;TRANSFER PROGRAM
JRST WHICH ;GO TO PROGRAM
DEPHASE
;DETERMINE WHICH DX10 PERFORMED THE READ-IN
WHICH: MOVE 1,CONIX ;GET CONI INSTRUCTION
XCT 1 ;EXECUTE CONI
TLNE RUNIND ;SKIP IF NOT RUNNING
JRST SETCOD ;FOUND DX10
TLC 1,(1B9) ;CHANGE CODE TO 224
JRST WHICH+1 ;CHECK THIS CODE
;STORE TABLE OF I/O INSTRUCTION WITH SELECTED DEVICE CODE
SETCOD: MOVEM 1,CONIX ;STORE CONI
LSH 1,-^D26 ;POSITION DEVICE CODE
DPB 1,CONOP ;PUT IT IN CONO INSTRUCTION
DPB 1,DATAIP ;PUT IT IN DATAI INSTRUCTION
DPB 1,DATAOP ;PUT IT IN DATAO INSTRUCTION
;READ THE OTHER RECORED INTO CORE AND TRANSFER THEM
;TO MEMORY. THESE RECORDS ARE BOOTM.
READRC: XCT CONOX ;CONTINUE THE READ
XCT CONIX ;EXECUTE CONI
JUMPG .-1 ;WAIT TILL DX10 LOAD I/O BUS
XCT DATAIX ;CLEAR I/O BUS
XCT DATAIX ;BOTH WORDS
HRLZI 1,20 ;SET UP BLT POINTER
HRR 1,LOCATE ;START AT ADR IN LOCATE
MOVEI 2,200-20 ;TRANSFER FULL RECORD LESS THE AC'S
ADDB 2,LOCATE ;UPDATE LOCATE FOR NEXT RECORD
BLT 1,-1(2) ;TRANSFER THE DATA
SOSLE RECDS ;REPEAT UNTIL ALL RECORDS READ
JRST READRC
;GET UNIT NUMBER OF DEVICE FROM WHICH FILE WAS READ
MOVE [RSEL,,MPADR] ;SELECT 8A'S CPMA ON IBUS
TLO DXCLR ;RESET THE DX10 ALSO
XCT DATAOX
MOVEI UNITNM ;GET ADR OF UNIT #
XCT DATAOX ;LOAD ADDRESS
MOVE [RSEL,,MPCTL] ;SELECT 8A CONTROL REGISTER
XCT DATAOX
MOVEI ENEXM ;CAUSE A MEMORY READ
XCT DATAOX
XCT DATAIX ;GET THE DATA
ANDI 17 ;CLEAR OTHER BITS
HRLI 3 ;CTL TYPE OF DX10
MOVEM UNIT## ;SAVE UNIT #
;LOAD THE MICRO-CODE INTO THE 8A MEMORY
LOADMC: MOVE [RSEL,,MPADR] ;SELECT CPMA ON IBUS
XCT DATAOX
MOVEI 0 ;LOAD ADR 0
XCT DATAOX
MOVE [RSEL,,MPCTL] ;SELECT 8A CONTROL REGISTER
XCT DATAOX
MOVE 1,MEM8P ;BYTE POINTER TO 8 MEMORY IMAGE
MOVEI 2,10000 ;COUNT OF DATA WORDS
LOAD8A: ILDB 1 ;GET A DATA WORD
TRO ENDEP ;SET ENABLE DEPOSIT BIT
XCT DATAOX ;WRITE WORD INTO MEMORY
SOJG 2,LOAD8A ;WRITE ALL WORDS
IFN DX20,<
SET20: JSR LOAD20 ;START THE DX20 MICRO (PATHED OUT IF NO SYS:DXMCA.ADX)
>
JRST @STRTAD ;START BOOTM
NXMW: 0 ;NXM BIT FOR CONI INSTR
;1080 STARTING POINT
START: CONO APR,IOCLR ;IO RESET
MOVE P,[-20,,PLIST] ;SET UP PDL
CONO PAG,0
CONO DTE,20
MOVSI DXCLR ;RESET DX10
XCT DATAOX
SETZM UNIT## ;DONT KNOW
JRST LOADMC ;NOW LOAD DX AND START BOOTM
LIT
ENDIN: 0 ;END OF READIN RECORD
LOC 440
;THIS CODE WILL BE EXECUTED ONLY IN USER MODE TO
;CREATE THE READ-IN FILE FOR TU70 READ-IN.
;READ THE MICRO-CODE FILE DXMPA.BIN AND TRANSLATE INTO
;PDP-8A CORE IMAGE
BEGIN: SUBTTL USER-MODE SETUP FOR DX10
MOVE P,[-20,,PLIST] ;SET UP PUSH LIST
MOVEI BOOTM## ;START ADDRS OF BOOTM
CAIG MEM8E ;CHECK OVERLAP
JRST BADLOD ;INFORM USER
MOVE FILL ;GET WORD OF HALT INSTRUCTIONS
MOVEM MEM8 ;PUT IN 8 MEMORY IMAGE
MOVSI MEM8 ;BUILD BLT POINTER
HRRI MEM8+1 ;TO FILL ALL OF 8 MEMORY IMAGE
BLT MEM8E ;WITH HALT INSTRUCTIONS
SETOM A8FLG ;INIT FLAG
MOVSI 'A8 '
HLLZM FNAME+1 ;AND EXTENSION
INIT 10 ;INITIALIZE DISK FOR IMAGE MODE
SIXBIT /SYS/ ;CALL DEVICE SYS
EXP BUF ;SPECIFY INPUT BUFFER
JRST INTERI ;INIT ERROR
RELOOK: LOOKUP FNAME ;LOOKUP MICRO-CODE BINARY FILE
JRST [HLRZ FNAME+1
CAIE 'A8 '
JRST NOMICR
SETZM A8FLG
MOVSI 'BIN'
HLLZM FNAME+1
JRST RELOOK]
INBUF ;SET UP BUFFER
SKIPE A8FLG
JRST MCA8 ;LOAD .A8 FILE
PUSHJ P,CHRIN ;READ A CHARACTER FROM PAPER TAPE
JUMPE .-1 ;IGNORE IT IF ZERO
CAIE 200 ;FIND LEADER
JRST NOLEAD ;NO LEADER?
PUSHJ P,WRDIN ;GET ALL LEADER CHARACTERS
CAIN 1,20000 ;STILL LEADER?
JRST .-2 ;YES, KEEP IT COMING
TRZN 1,10000 ;FIRST WORD, BETTER BE ADDRESS
JRST BADCHR
SETZM CHECK ;CLEAR CHECKSUM
MCADR: ADDM 4,CHECK ;UPDATE CHECKSUM
IDIVI 1,3 ;GET ADDRESS OF STORAGE WORD
ADDI 1,MEM8
MOVEM 1,PNTR ;STORE AS POINTER ADR
IMULI 2,^D12 ;COMPUTE BYTE POSITION
MOVEI 1,^D36 ;FROM REMAINDER
SUB 1,2 ;IN FIRST
LSH 1,^D12 ;POSITION NUMBER
ORI 1,^D12_6 ;BYTE SIZE
HRLM 1,PNTR ;COMPLETE POINTER
PUSHJ P,WRDIN ;GET DATA WORD
MCDATA: TRCE 1,10000 ;DATA OR ADDRESS?
JRST MCADR ;ADDRESS - GO LOAD IT
MOVEM 1,NUMSAV ;SAVE THIS DATA ENTRY
MOVEM 4,DCSAV ;SAVE ASSOCIATED CHECKSUM ENTRY
PUSHJ P,WRDIN ;READ NEXT WORD FROM TAPE
TRNE 1,20000 ;SKIP IF NEXT ENTRY IS NOT TRAILER
JRST MCSUM ;LAST ENTRY WAS CHECKSUM
MCCONT: MOVE 2,DCSAV ;GET SAVED CHECKSUM ENTRY
ADDM 2,CHECK ;UPDATE CHECKSUM
MOVE 2,NUMSAV ;GET DATA ENTRY
IDPB 2,PNTR ;STORE DATA IN TABLE
JRST MCDATA ;GET NEXT WORD FROM TAPE
;NUMSAV CONTAINS CHECKSUM FROM TAPE
;CHECK CONTAINS COMPUTED CHECKSUM
MCSUM: MOVE 4,CHECK ;GET COMPUTED CHECKSUM
ANDI 4,7777 ;STRIP TO 12 BITS
MOVE 1,NUMSAV ;GET CHECKSUM FROM TAPE
ANDI 1,7777 ;STRIP TO 12 BITS
CAME 4,1 ;CHECK IF CHECKSUMS MATCH
JRST BADCHK ;CHECKSUM ERROR
SETUP2:
IFN DX20,<
LOOKUP DX2NAM
JRST [OUTSTR [ASCIZ /%SYS:DXMCA.ADX NOT FOUND, WONT LOAD DX20
/]
MOVSI T1,(JFCL)
MOVEM T1,SET20
JRST WRTIT]
MOVSI 440700
HLLM BUFP
SETSTS 0
PUSHJ P,READ20
>
WRTIT: RESET ;INITIALIZE I/O
MOVEI 4756 ;MAJIK BITS
DPB [POINT 12,MEM8+<17/3>,11]
JRST OTBUF ;GO TO WRITE OUTPUT FILE
;READ FROM THE FILE
;READ A CHARACTER, CHECK FOR ERROR
CHRIN: SOSGE BUFC ;DECREMENT THE COUNT
JRST GETBF ;GET ANOTHER BUFFER
ILDB BUFP ;GET DATA
ADDM 4 ;COMPUTE CHECKSUM FOR THIS ENTRY
POPJ P, ;RETURN
GETBF: IN ;GET A BUFFER
JRST CHRIN ;NO ERROR, JUMP BACK
OUTSTR .+2
EXIT
ASCIZ /
INPUT ERROR FROM DXMPA.BIN/
;READ A PAIR OR CHARACTERS THAT FORM AN ADDRESS OR DATA WORD
WRDIN: SETZ 4, ;CLEAR CHECKSUM ENTRY STORAGE
PUSHJ P,CHRIN ;GET A CHARACTER
LSH 6 ;SHIFT DATA
MOVEM 1
TRNE 20000 ;SKIP IF CHANNEL 8 IS ZERO
JRST CH8
PUSHJ P,CHRIN ;GET SECOND CHARACTER
TRNE 300 ;SKIP IF CHANNELS 7 & 8 ARE ZERO
JRST BADCHR ;BAD CHARACTER
ORM 1 ;MERGE THE TWO CHARACTERS
POPJ P,
CH8: TRNE 7700 ;SKIP IF CHANNELS 1 TO 6 ARE ZERO
JRST BADCHR ;BAD CHARACTER
TRNN 10000 ;SKIP IF CHANNEL 7 IS NOT ZERO
POPJ P, ;LEADER OR TRAILER
JRST WRDIN ;FIELD SET 0, IGNORE IT
;ROUTINE TO LOAD A8 FILES
MCA8: SETZM CHECK ;CLEAR THIS
SETSTS 0 ;CHANGE TO MODE 0
MOVSI (POINT 7,,)
HLLM BUFP
LDA8WC: PUSHJ P,WCREAD ;GET WORD COUNT IN WC
JUMPE P1,SETUP2 ;DONE IF ZERO
MOVE WC,P1
PUSHJ P,WDREAD ;GET DATA WORD
PUSH P,P2
IDIVI P1,3
ADDI P1,MEM8
MOVEM P1,PNTR
IMULI P2,^D12
MOVEI P1,^D36
SUB P1,P2
LSH P1,^D12
IORI P1,^D12_6
HRLM P1,PNTR ;FORM BYTE PNTR
POP P,P2 ;RESTORE
LDA8D: PUSHJ P,WDREAD ;GET WORD
IDPB P1,PNTR ;STASH WORD
SOJG WC,LDA8D ;LOOP THROUGH ALL WORDS
PUSHJ P,CHREAD ;READ AND VERIFY CHECKSUM
JRST LDA8WC ;GET NEXT RECORD
;ROUTINE TO READ THE CHECKSUM FROM FILE AND THE CRLF
;CHECK THAT CHECKSUM IS CORRECT
CHREAD: PUSHJ P,GET2W ;GET A WORD
CAIE P2,15 ;TERMINATOR BETTER BE CR
ERROR <End-of-line missing>
ADD P1,CHECK ;ADD COMPUTED CHECKSUM
ANDI P1,7777 ;CHECKIT
JUMPN P1,[ERROR <Checksums do not agree>]
PUSHJ P,GETC ;GET LF
CAIE P1,12 ;DOUBLE CHECK CRLF
ERROR <End-of-line missing>
POPJ P, ;RETURN
;PDP-8 A8 UTILITIES
GET2W: PUSH P,[0] ;INIT ANSWER
PUSHJ P,GETA8 ;GET FIRST CHAR
JRST GET2X ;EXIT IF NOT DIGIT
MOVEM P1,0(P) ;STASH ON PDL
PUSHJ P,GETA8 ;GET NEXT
JRST GET2X ;MUST BE SINGLE DIGIT
EXCH P1,0(P) ;NEW LOW ORDER BYTE
LSH P1,6 ;MAKE HIGH ORDER BYTE
IORM P1,0(P) ;COMBINE
PUSHJ P,GETC ;GET NEXT FILE CHAR
GET2X: MOVE P2,P1 ;RETURN BREAK CHAR IN P2
POP P,P1 ;RESTORE WORD TO P1
POPJ P, ;EXIT
;GET NEXT FILE CHAR AND RETURN LOW 6 BITS
GETA8: PUSHJ P,GETC ;GET CHAR FROM FILE
CAIE P1,"," ;CHECK TERMINATOR
CAIN P1,15
POPJ P, ;NON SKIP RETURN
ANDI P1,77 ;TRIM TO LOW ORDER 6-BIT
AOS 0(P)
POPJ P,
;GET WORD COUNT FFROM FILE
WCREAD: PUSHJ P,GETC ;GET CHARACTER
CAIE P1,"8" ;CHECK VALIDITY
JRST [PUSHJ P,SKPCOM ;SKIP COMMENT
JRST WCREAD]
PUSHJ P,GETC ;GET NEXT CHARACERR
CAIE P1," " ;BETTER BE A SPACE
ERROR <File not in correct A8 format>
SETZM CHECK ;INIT CHECKSUM
;NOW GET DATA WORD
WDREAD: PUSHJ P,GET2W ;GET 12 BIT NUMBER
ADDM P1,CHECK ;ADD TO CHECKSUM
CAIE P2,"," ;GRNTEE COMMA TERMINATOR
ERROR <File not in correct A8 format>
POPJ P, ;RETURN (ANSWER IN P1)
;ROUTINE TO SKIP COMMENTS
SKPCOM: CAIE P1,";" ;VALID COMMENT CHAR?
ERROR <File not in A8 format>
SKPCM1: PUSHJ P,GETC ;GET CHAR TILL EOL
CAIE P1,12 ;LINE FEED?
JRST SKPCM1 ;NO - LOOP
POPJ P, ;YES - RETURN
;ROUTINE TO GET NEXT CHAR FROM FILE
GETC: SOSG BUFC
PUSHJ P,GETBYI
ILDB P1,BUFP
POPJ P,
GETBYI: IN
POPJ P,
STATZ 740000
ERROR <INPUT FILE READ ERROR>
STATZ 20000
ERROR <UNEXPECTED EOF>
POPJ P,
NOLEAD: OUTSTR .+2
EXIT
ASCIZ /
?FIRST NON-ZERO CHARACTER READ FROM PAPER TAPE WAS NOT THE
EXPECTED LEADER CODE.
/
BADCHR: OUTSTR .+2
EXIT
ASCIZ /
?UNEXPECTED CHARACTER READ FROM PAPER TAPE.
/
BADCHK: OUTSTR .+2
EXIT
ASCIZ /
?CHECKSUMS DO NOT AGREE.
/
BADLOD: OUTSTR .+2
EXIT
ASCIZ /
?BOOTM OVERLAPS MEM8 - SEE BOOTM LISTING.
/
;WRITE THE OUTPUT FILE BOOTM.RDI
OTBUF: INIT 10 ;INIT DISK FOR IMAGE MODE
SIXBIT /OUT/ ;CALL DEVICE OUT
XWD BUF,0 ;SPECIFY OUTPUT BUFFER
JRST [OUTSTR INTERO
EXIT 1,
JRST OTBUF]
ENTER ONAME ;ENTER READ-IN FILE
JRST ENTRER ;ENTER ERROR
OUTPUT ;SET UP OUTPUT BUFFER
IFN DX20,<
MOVSI 10,(JFCL)
EXCH 10,SET20 ;CAUSE READIN STUFF DOESNT TALK TO RH20
>
MOVNI 1,READIN-<LOCATE-CONIX+2>;ZERO WORDS
MOVEI 2,CONIX ;ADR OF FIRST WORD
MOVEI 3,EBTM## ;END OF BOOTM
SUBI 3,MEM8 ;LENGTH OF STUFF
IDIVI 3,<200-20>
AOS 3 ;PLUS ONE
MOVEM 3,RECDS ;SAVE IN CORE IMAGE
ADDI 3,1 ;PLUS INITIAL RECORD
OUTREC: ADDM 1,BUFC ;DECREMENT COUNTER BY C(AC1)
CAMN 3,RECDS ;CHECK IF FIRST RECORD
MOVEI 2,MEM8 ;AFTER INITIAL, SET IN START ADDRESS
SETZ ;CLEAR AC0
IDPB BUFP ;STORE ZERO WORD
AOJL 1,.-1 ;COUNT THE WORDS
OUTW1: MOVE (2) ;GET WORD
IDPB BUFP ;STORE WORD IN BUFFER
ADDI 2,1 ;INCREMENT ADDRESS
SOSLE BUFC ;DECREMENT COUNTER
JRST OUTW1 ;WRITE ALL WORDS
OUT ;WRITE THE BUFFER
JRST OUTW2 ;NO ERRORS
OUTSTR OUTERR
EXIT
OUTW2: MOVNI 1,20 ;20 ZERO WORDS IN EACH BUFFER
SOJG 3,OUTREC ;COUNT RECORDS
CLOSE
IFN DX20,<
MOVEM 10,SET20
HLLZS DX2NAM+1
SETZM DX2NAM+2 ;RESET LOOKUP FIELDS
>
HLLZS FNAME+1
SETZM FNAME+2
HLLZS ONAME+1
SETZM ONAME+2 ;RESET FIELDS SO BOOTM CHECKSUM NOT AFFECTED
SETZM ONAME+3
MOVEI START ;SET UP NEW START ADDRS
HRRM .JBSA##
RESET ;RESET .JBFF
OUTSTR [ASCIZ \TYPE ".SAVE BOOTM" FOR 1080/TU70 BOOTSTRAP.
\]
EXIT
FILL: BYTE (12) 7402, 7402, 7402 ;HALT INSTRUCTIONS
BUF: 0
BUFP: 0 ;BUFFER BYTE POINTER
BUFC: 0 ;BUFFER COUNTER
FNAME: SIXBIT /DXMPA/ ;MICRO-CODE FILE NAME
SIXBIT /A8/ ;A8ARY FILE
0
0
PNTR: 0 ;POINTER TO 8A CORE IMAGE
NUMSAV: 0
A8FLG: 0
DCSAV: 0
CHECK: 0 ;CHECK SUM
ONAME: SIXBIT /BOOTM/ ;OUTPUT FILE NAME
SIXBIT /RDI/ ;RDI EXTENSION
0
0
INTERI: OUTSTR .+2
EXIT
ASCIZ /
?INIT ERROR FOR INPUT FROM DXMPA/
NOMICR: OUTSTR .+2
EXIT
ASCIZ /
?LOOKUP ERROR FOR INPUT FILE DXMPA/
INTERO: ASCIZ /
%ASSIGN LOGICAL DEVICE "OUT" AND TYPE CONTINUE.
/
ENTRER: OUTSTR .+2
EXIT
ASCIZ /
?ENTER ERROR FOR BOOTM.RDI/
OUTERR: ASCIZ /
?OUTPUT ERROR FOR BOOTM.RDI/
SUBTTL DX20 PARAMETERS
;RH20 CONI/CONO BITS
;CONI (RH)
CI.BPE==1B18 ;DATA BUS PARITY ERROR
CI.EXC==1B19 ;EXCEPTION
CI.LWE==1B20 ;LONG WORD COUNT ERROR
CI.SWE==1B21 ;SHORT WORD COUNT ERROR
CI.MBE==1B22 ;MBOX ERROR
CI.DRE==1B23 ;DRIVE RESPONSE ERROR
CI.RAE==1B24 ;REGISTER ACCESS ERROR
CI.MBH==1B25 ;MBOX HALTED
CI.OVR==1B26 ;DATA OVERRUN
CI.MEN==1B27 ;MASSBUS ENABLE
CI.ATN==1B28 ;DRIVE ATTENTION
CI.2RF==1B29 ;SECONDARY COMMAND REGISTER FULL
CI.ATE==1B30 ;ATTENTION EBABLE
CI.1RF==1B31 ;PRIMARY COMMAND REGISTER FULL
CI.DON==1B32 ;CHANNEL DONE
CI.PIA==7 ;PRIORITY ASSIGNMENT
CI.ERR==555000 ;BITS THAT CAUSE ERRORS
;CONO
CO.RAE==1B24 ;CLEAR REGISTER ACCESS ERROR
CO.RST==1B25 ;CONTROLLER RESET
CO.XFR==1B26 ;CLEAR TRANSFER ERROR
CO.MEN==1B27 ;MASSBUS ENABLE
CO.RCL==1B28 ;RESET MBOX COMMAND LIST POINTER
CO.DEL==1B29 ;DELETE SECONDARY COMMAN
CO.ATE==1B30 ;ENABLE ATTENTION INTERRUPTS
CO.STP==1B31 ;STOP CURRENT COMMAND
CO.DON==1B32 ;CLEAR DONE
CO.CLR==005010 ;CLEAR BITS THAT CAUSE INTERRUPTS
;DX20 REGISTERS
DXCTR==0 ;CONTROL REGISTER
DXSTR==1 ;STATUS REGISTER
DXERR==2 ;ERROR REGISTER
DXMTR==3 ;MAINTENNANCE REGISTER
DXASR==4 ;ATTENTION SUMMARY REGISTER
DXDTR==6 ;DRIVE TYPE AND HARDWARE VERSION REG.
DXDR0==30 ;DIAGNOSTIC REGISTER
; IR FOR MICROPROCESSOR
DXDR1==31 ;DIAGNOSTIC REGISTER
DXDR5==35 ;DIAGNOSTIC REGISTER 5
DXDR7==37 ;DIAGNOSTIC REGISTER 7
;DXMTR BITS & FIELDS
MP.SC==1B31 ;SINGLE CYCLE
WR.EP==1B32 ;WRITE SINGLE PARITY
MP.STA==1B33 ;MP START
DX.RST==1B34 ;BIT FOR RESET DX20
;DXDR1 BITS & FIELDS
IR.EN==1B20 ;ENABLE IR LOAD FROM MICRO-STORE
MS.EN==1B21 ;ENABLE MICRO-STORE LOAD FROM IR
PC.EN==1B22 ;ALLOW LOAD/WRITE OF PC
PC.AI==1B23 ;ENABLE PC AUTO-INCREMENTING
DX.PC=7777B35 ;MASK FOR THE PC
;DXDR7 BITS & FIELDS
IR.PER==1B22 ;IR PARITY ERROR
;COMMON DATAO BITS & FIELDS
DO.RS: POINT 6,T2,5 ;REGISTER SELECT FIELD
DO.LR==1B6 ;LOAD REGISTER ENABLE
DO.DRE==1B9 ;DISABLE RAE STOP
;COMMON DATAI BITS
DI.CPE==1B8 ;CONTROL BUS PARITY ERROR
DI.TRA==1B10 ;TRA (MASSBUS SIGNAL)
;MASS BUS DEVICE TYPES
TY.RP4==020 ;RP04 DRIVE TYPE
TY.RS4==001 ;RS04 DRIVE TYPE
TY.TML==010 ;LOWEST TM02 TYPE
TY.TMH==017 ;HIGHEST TM02 TYPE
TY.DX2==60 ;DX20 DRIVE TYPE***(=050060)
; VERSION # IS 100****(100017)
;FIELD DEFINITION FOR DX20 REGISTERS
DT.TYP: POINT 9,T1,35 ;TYPE FIELD IN DRIVE-TYPE REGISTER
SUBTTL DX20 USER-MODE SETUP
;HERE TO SET UP THE DX20 MICROCODE
READ20: PUSHJ P,GETLIN
JUMPE T1,RD2END
MOVNS T1
HRLZS T1
SKIPN CFLAG
JRST DRAM
ROT T2,-1
TLZN T2,400000
TLOA T2,442200
TLO T2,222200
ADDI T2,CRDAT
JRST STOR20
DRAM: IDIVI T2,4
HLL T2,[441000,,
341000,,
241000,,
141000,,](T3)
ADDI T2,DRDAT
STOR20: MOVE T3,LINDAT(T1)
IDPB T3,T2
AOBJN T1,STOR20
JRST READ20
RD2END: SKIPE T2
MOVEM T2,A.STRT
POPJ P,
;GETLIN - READS IN A LINE OF DATA WORDS TO BE LOADED INTO CRAM OR
; WORKING MEMORY
;
; CALL GETLIN
;
; RETURN+1: ALWAYS
; LINDAT IS THE TALBE WHICH HAS THE CONVERTED DATA WORDS
; T1/ WORD COUNT OF DATA WORDS IN THE TABLE
; T2/ LOAD ADDR
; CFLAG PROPERLY SET, 1S=DATA WORDS FOR CRAM, 0= FOR WORKING MEMORY
; USES P1 AS PTR, P2 AS LOOP INDEX
GETLN0: PUSHJ P,GETC
CAIE P1,12
JRST GETLN0
GETLIN: MOVE T4,[LINWC,,LINWC+1] ;INITIALIZE WORK AREA
SETZM LINWC ;
BLT T4,CHKSUM
MOVEI T3,^D32*5 ;MAXIMUN NUMBER OF CHAR.S
SETZM CFLAG# ;CFLAG=1S MEANS FOR CRAM
PUSHJ P,GETC
CAIN P1,";" ;IS IT COMMENT LINE?
JRST GETLN0 ;YES, IGNORE IT
CAIE P1,"C" ;CRAM LOAD LINE?
JRST GTLNA ;NO, SEE IF WM LOAD LINE
SETOM CFLAG ;YES, SET FLAG
JRST GTLNB ;JUMP AROUND
GTLNA: CAIE P1,"W" ;WM LOAD LINE?
ERROR <1st character wrong in dataline>
GTLNB: PUSHJ P,GETC ;GET NEXT CHAR.
CAIE P1," " ;MUST BE BLANK
ERROR <2nd character wrong in dataline>
PUSHJ P,GTWRD ;GET NEXT WORD
ERROR <format error in dataline>
MOVEM T1,LINWC ;SAVE WORD COUNT FOR THE LINE
MOVEM T1,CHKSUM ;INITIALIZE CHECKSUM FOR THE LINE
PUSHJ P,GTWRD ;GET NEXT WORD
ERROR <format error in dataline>
ADDM T1,CHKSUM ;UPDATE CHKSUM
DPB T1,[POINT 16,LINWC,19] ;SAVE LOAD ADDR.
MOVSI P2,-^D32 ;SETUP LOOP INDEX FOR SUBSEQUENT WORDS
; LINDAT HOLDS AT MOST 32 WORDS
GETLI1: PUSHJ P,GTWRD ;GET NEXT WORD
JRST GETLI2 ;LAST WORD, CHKSUM, READ IN T1
ADDM T1,CHKSUM ;UPDATE CHKSUM
MOVEM T1,LINDAT(P2) ;SAVE DATA WORD
AOBJN P2,GETLI1 ;LOOP BACK
ERROR <too many words in dataline>
GETLI2: MOVEM T1,LINDAT(P2) ;SAVE EVEN CHKSUM
ADD T1,CHKSUM ;ADD CHKSUM INTO T1
TRNE T1,177777 ;CHECKSUM SHOULD BE 0
ERROR <checksum error in dataline>
LDB T1,[POINT 16,LINWC,35] ;WC IN T1
LDB T2,[POINT 16,LINWC,19] ;LOAD ADDR. IN T2
POPJ P, ;NONSKIP RETURN
;GTWRD - GET A DATA WORD FROM DATLIN WHICH IS A CHAR. STRING
; CONVERT THE ASCIIZED DATA WORD INTO BINARY
;
; CALL GTWRD
;
; RETURN+1: DATA WORD DELIMITED BY CR
; RETURN+2: DATA WORD DELIMITED BY ,
; T1/ CONVERTED DATA WORD
; USES P1 AS PTR
GTWRD: SETZ T1, ;T1 WILL HAVE RESULT DATA
GTWRD1: PUSHJ P,GETC
CAIN P1,"," ;SKIP IF NOT COMMA
JRST CPOPJ1 ;GOT THE DATA WORD
;SKIP RETURN
CAIN P1,15 ;SKIP IF NOT CR
JRST GTWRD1 ;CR, THROW IT AWAY AND LOOK FOR LF
CAIN P1,12
POPJ P, ;RETURN, GOT LAST DATA WORD IN LINE
LSH T1,6 ;MAKE ROOM
CAIE P1," " ;SKIP IF BLANK
DPB P1,[POINT 6,T1,35] ;PUT IN T1, UNASCIIZED THE BYTE
JRST GTWRD1 ;GET NEXT CHAR.
SUBTTL UTILITY SUBROUTINES
;ROUTINE TO GET NEXT BYTE FROM FILE
;RETURNS BYTE IN P1 / PARTIAL CKSUM IN P2
GETBYT: PUSHJ P,GETC ;GET FILE CHAR
ADD P2,P1 ;ADD INTO CKSYM
POPJ P, ;RETURN
;ROUTINE TO GET NEXT WORD FROM FILE
;RETURNS 20000 IF LEADER/TRAILER , 1XXXX IF ADDRESS
;YYYY IF JUST DATA WORD
GETWRD: MOVEI P2,0 ;PARTIAL CKSUM TO ZERO
PUSHJ P,GETBYT ;GET A BYTE
LSH P1,6 ;PUT IN CORRECT PLACE
TRNE P1,20000 ;CHECK FOR LEADER/TRAILER
JRST GETCH8 ;CHECK CHL 8
PUSH P,P1 ;SAVE FIRST CHAR
PUSHJ P,GETBYT ;GET 2ND BYTE
TRNE P1,300 ;BETTER HAVE 7/8 ZERO
ERROR Illegal 2nd character
IOR P1,0(P) ;COMBINE
TPOPJ: POP P,T1 ;PRUNE PDL
CPOPJ: POPJ P, ;EXIT
;HERE TO CHECK RANDOMNESS
GETCH8: TRNE P1,7700 ;GOT ANYTHING
ERROR <Trash in file>
TRNN P1,10000 ;IGNORE FIELD SET ZERO
POPJ P,
JRST GETWRD ;...
SUBTTL DX20 EXEC-MODE STUFF
LOAD20: 0
MOVEI T4,540/4
LOAD2A: DPB T4,[POINT 7,RH2CNO,9]
DPB T4,[POINT 7,RH2DTO,9]
DPB T4,[POINT 7,RH2DTI,9]
MOVEM T4,DX2RH2## ;SAVE KONTROLLER FOR BOOTM
MOVEI T1,CO.MEN
XCT RH2CNO
MOVEI T3,DXDTR
PUSHJ P,RDREG
ANDI T1,777
CAIN T1,TY.DX2
JRST HAV20
ADDI T4,1
CAIG T4,574/4
JRST LOAD2A
JRST @LOAD20
HAV20: MOVE P1,[POINT 18,CRDAT]
SETZ P2,
LOADCR: MOVE T2,P2
PUSHJ P,PRECR ;SET UP PC FOR CRAM
ILDB T2,P1
CAIN P2,MAGICA
MOVEI T2,MAGICV
MOVEI T3,DXDR0 ;SELECT IR
PUSHJ P,WTREG ;LOAD CRAM FROM IR
CAIGE P2,3777
AOJA P2,LOADCR
PREWT (DXDR1) ;SELCT PC
TRO T2,IR.EN+PC.EN ;PC=0, SET FLAGS
PUSHJ P,WTREG ;SET PC
MOVEI T3,DXDR0 ;SELCT IR
PUSHJ P,RDREG ;READ IR FROM CRAM, PC=0
MOVEM T1,PC0SAV# ;SAVE LOC. 0
MOVE P1,[POINT 8,DRDAT]
SETZ P2,
LOADDR: MOVE T2,P2
PUSHJ P,PREWM ;SET UP MA TO LOAD DRAM
ILDB T1,P1
TRO T1,11400 ;MAKE MICROINSTR. (MOVEI MEM MA+1)
PUSHJ P,XI ;EXECUTE MICROINSTR
CAIGE P2,1777
AOJA P2,LOADDR
PUSHJ P,POSWM
JRST @LOAD20
;PREWM - SETS UP THE LOAD ADDR. FOR WORKING MEMORY
; ALSO, SAVES LOC. 0 OF CRAM FOR MICROINSTR. EXECUTION
; T2/ LOAD ADDR.
;
; CALL PREWM
;
; RETURN+1: ALWAYS
PREWM: MOVEM T2,WMADR# ;SAVE LOAD ADDR.
MOVE T1,WMADR ;GET LOAD ADDR.
ANDI T1,377 ;MAX. ADDR. 256
TRO T1,1000 ;MAKE MICROINTR. (MOVEI LOAD MA)
PUSHJ P,XI ;SET MA REGISTER
MOVE T1,WMADR ;GET LOAD ADDR. AGAIN
LSH T1,-^D8 ;KEEP 2 MAEX BITS
TRO T1,400 ;MAKE MICROINTR. (MOVEI LOAD MAEX)
JRST XI ;SET MAEX BITS AND RETURN
;POSWM - RESTORES LOC. 0 OF CRAM AFTER WORKING WITH WORKING MEMORY
;
; CALL POSWM
;
; RETURN+1: ALWAYS
POSWM: PREWT (DXDR1) ;SELCT PC
TRO T2,PC.EN+MS.EN ;PC=0
PUSHJ P,WTREG ;SET PC
MOVE T2,PC0SAV ;GET C(LOC 0 OF CRAM)
MOVEI T3,DXDR0 ;SELCT IR
JRST WTREG ;WRITE CRAM FROM IR
; AND RETURN
;PRECR - SETS UP PC FOR LOADING OR VERIFYING CRAM
; T2/ LOAD ADDR.
;
; CALL PRECR
;
PRECR: ANDI T2,7777 ;MAKE SURE 12 BITS PC
TRO T2,MS.EN+PC.EN+PC.AI ;SET BITS
MOVEI T3,DXDR1 ;SELCT PC
JRST WTREG ;WRITE PC AND RETURN
;XI - EXECUTE INSTR. IN T1
;
; CALL XI
;
; RETURN+1: ALWAYS
; CHANGES T2,T3,&T4
; PRESERVES T1
XI: PREWT (DXMTR) ;SELCT DXMTR
TRO T2,MP.SC ;CLEAR START BIT & SET SINGLE CYCLE BIT
PUSHJ P,WTREG ;STOP MICROPROCESSOR
PREWT (DXDR1) ;CLR PC
TRO T2,PC.EN+MS.EN ; AND SET BITS
PUSHJ P,WTREG ;DO IT
PREWT (DXDR0) ;LOAD IR WITH INSTR.
MOVE T2,T1 ; AND LOAD IT IN LOC. 0, ALSO
PUSHJ P,WTREG ;
PREWT (DXDR1) ;SELCT PC REG.
TRO T2,IR.EN+PC.AI ;SET IR.EN & PC.AI BIT
PUSHJ P,WTREG ;PC HAS 0
PREWT (DXMTR) ;READY TO EXECUTE
TRO T2,MP.SC+MP.STA ;SET SINGLE STEP & START BITS
PUSHJ P,WTREG ;GO START MICROCONTROLLER
PREWT (DXMTR) ;CLEAR START BIT
TRO T2,MP.SC ;LEAVE SINGLE CYCLE BIT ON
JRST WTREG ;DO IT AND RETURN
SUBTTL MODULE FOR RH20 HANDLING ROUTINES
;DEVXCT - EXECUTES IOT(INPUT/OUTPUT TRANSFER INSTR.) FOUND AT CALL+1
; T3/ DEVICE CODE
;
; CALL DEVXCT
; RETURN+1: ALWAYS
DEVXCT: MOVE T4,@(P) ;FETCH IOT
IOR T4,T3 ;GET DEVICE CODE
XCT T4 ;EXECUTE IT
CPOPJ1: AOS (P) ;SKIP OVER IOT INSTR.
POPJ P,
;WTREG - WRITES INTERNAL OR EXTERNAL REGISTER
; T3/ REGISTER SELECT NUMBER
; T2/ BIT 18-35 ARE SPECIFIED
;
; CALL WTREG
; RETURN+1:ALWAYS
; DESTROYS T2
WTREG: DPB T3,DO.RS ;SET RS FIELD BIT 0-5 IN T2
TLO T2,(DO.LR) ;SET LR LOAD
JUMPL T2,WTREG1 ;JUMP IF INTERNAL REG.
TLO T2,<(DO.DRE)> ;SET DRAES BIT & DRIVE NUMBER
;DO.EP BIT 0 ALREADY
WTREG1: XCT RH2DTO ;WRITE IT
POPJ P, ;JUST RETURN
;RDREG - READS INTERNAL OR EXTERNAL REGISTER
; T3/ REGISTER NUMBER
;
; CALL RDREG
;
; RETURN+1: ALWAYS
; T1 GETS VALUE
RDREG: SETZB T2,T1 ;CLEAR THEM
DPB T3,DO.RS ;SET REGISTER SELECT
; DO.LR IS 0 ALREADY
JUMPL T2,RDREG1 ;JUMP ,IF INTERNAL
TLO T2,<(DO.DRE)> ;SET DRAES BIT & DRIVE NUMBER
;DO.EP BIT 0 ALREADY
RDREG1: XCT RH2DTO ;SET PREPARATION REGISTER
XCT RH2DTI ;READ IN T1
ANDI T1,177777 ;CLEAR OUT GARBAGE
POPJ P, ;RETURN
DX2NAM: SIXBIT /DXMCA/
SIXBIT /ADX/
0
0
LIT
VAR
RH2CNO: CONO (T1)
RH2DTO: DATAO T2
RH2DTI: DATAI T1
LINWC: BLOCK 1 ;LOAD ADDR,,WORD COUNT OF DATA LINE
LINDAT: BLOCK ^D32 ;SO MANY DATA WORDS
CHKSUM: BLOCK 1 ;CHECKSUM FOR DATALINE FROM FILE
A.STRT: BLOCK 1
INHDR: BLOCK 3
CRDAT: BLOCK 2000 ;ROOM FOR 2K*16 BITS - CRAM
DRDAT: BLOCK 400 ;ROOM FOR 1K*8 BITS - DRAM
MEM8: BLOCK 10000/3 ;PDP-8A MEMORY CORE IMAGE
MEM8E: 0
END BEGIN