Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50224/lod11x.mac
There are no other files named lod11x.mac in the archive.
TITLE LOD11X.MAC
SUBTTL H.FARNSWORTH
; EASTMAN KODAK
; O3/20/71
; VER 2
; (USES TTY- LIKE INTERFACE)
; PDP-11 BIN PROGRAMS SHOULD HAVE BEEN
; STORED ON DSK IN IMAGE MODE IN FORM:
; FILENAME.EXT
; WHERE FILENAME IS FROM 1 TO 6 CHAR LONG
; EXT IS 110
DSK=1
TTY=2
PDP=10
EOFSW=4 ; END OF FILE SWITCH
START: CALLI 0 ; CALL [SIXBIT/RESET/]
MOVE PDP, [IOWD 17, PDLIST]
INIT TTY, 1 ; SET TTY FOR ASCII LINE MODE
SIXBIT /TTY/
XWD TTYOUT, TTYIN ; BOTH INPUT AND OUTPUT
JRST .-3 ; MUST HAVE TTY
OUTBUF TTY, 1 ; SET UP ONE OUTPUT BUFFER
OUTPUT TTY, ; DUMMY OUTPUT
INIT DSK, 10 ; SET DSK FOR IMAGE MODE
SIXBIT /DSK/
XWD , DSKIN ; INPUT ONLY
JRST .-3
PUSHJ PDP, MESSAG
ASCIZ "
PDP-10/11 LOADER
ABS LOAD ALL SWITCHS DOWN.
REL LOAD SWITCH ADR.(15-1),(0) UP.
PROGRAM NAME,CR
"
OUTPUT TTY,
SETZ 1,
HRRZI 2, 5
PUSHJ PDP, READ ; READ CHAR AND CONVERT TO SIXBIT
JRST FINISH ; NAME < 6 CHAR LONG
MOVE 3, 2 ; SET UP TO SHIFT
IMULI 3, 6
LSH (3) ; SHIFT SIXBIT TO LEFT AND
IOR 1, 0 ; IOR TO BUILD UP FILENAME
SOJL 2, .+2 ; GOT 6 CHAR YET?
JRST .-7 ; NO
FINISH: MOVEM 1, NAME ; YES--PUT FILENAME IN "NAME"
SETZM TTYIN+2 ; IGNORE REST OF BUFFER
MOVSI 212120 ; SET INITIAL EXT= 110
MOVEM NAME+1
LOOKUP DSK, NAME
JRST NOTFND ; PROGRAM REQUESTED NOT FOUND
SETZM BLK ; PDP 11 OCTAL BLOCK NUMBER TO 0
PUSHJ PDP,SIGGO ; WAIT THAN SEND GO SIGNAL
LOOP: PUSHJ PDP,BUILD
PUSHJ PDP,INITA
PUSHJ PDP,PACK
SOJN 6,.-1
JRST FIN
PACK: PUSHJ PDP, CKSWS ; 1 GET A CHAR FROM DSK
MOVE 1, 0 ; MAKE FOUR PIECES OF DATA FROM THREE
ANDI 1, 3
LSH -2
IORI 100 ; SET "VALID DATA" BIT
PUSHJ PDP, OUT
PUSHJ PDP, CKSWS ; 2
LSH 1,10
IORB 0,1
ANDI 1,17
LSH 0,-4
IORI 0,100
PUSHJ PDP,OUT
PUSHJ PDP, CKSWS ; 3
LSH 1, 10
IORB 0,1
ANDI 1,77
LSH 0,-6
IORI 0,100
PUSHJ PDP,OUT
MOVE 0,1
IORI 0,100
PUSHJ PDP, OUT
POPJ PDP,
FIN: OUTPUT TTY,
PUSHJ PDP, READ ; READ FROM PDP-11
JRST .+3 ; CR--BLOCK LOADED CORRECTLY
CAIN 3 ; SIXBIT "#" ?
JRST OHNO ; YES: PDP-11 PROGRAM DID NOT LOAD CORRECTLY
TRNE 5,EOFSW
JRST END
JRST LOOP
INITA: MOVE 4,COUNT2
MOVE 6,COUNT1
MOVE 2,[POINT 8,BUFF]
POPJ PDP,
CKSWS: ILDB 0,2 ; GET DATA FROM BUFFER TO 0
CAIN 4,1 ; NEAR CKSUM ?
PUSHJ PDP,IGNORE ; IGNORE REST OF BUFFER
SOSL 4 ; DONE WITH PDP11 BLOCK ?
POPJ PDP, ; NO, RETURN
TRNN 5,EOFSW
POPJ PDP,
MOVE PDP,[IOWD 17,PDLIST]
JRST FIN
IGNORE: SETZM TTYIN+2
POPJ PDP,
ERR: 0
JRST 4, ; HALT,ERROR
GETCHR: SOSGE DSKIN+2
JRST GETBUF
ILDB DSKIN+1
POPJ PDP,
GETBUF: IN DSK,
JRST GETCHR
STATZ DSK, 740000
JRST GETBUF ; HOPE IT READS CORRECTLY NOW--
; LET PDP-11 DETECT CHECKSUM ERROR
CLOSE DSK,
POPJ PDP,
OUT: SOSG TTYOUT+2
OUTPUT TTY,
IDPB TTYOUT+1
POPJ PDP,
END: PUSHJ PDP,MESSAG
ASCIZ /
SWITCHES (15-1)UP,(0)DOWN
/
OUTPUT TTY,
CALLI 12 ; YES, THROUGH--CALL [SIXBIT/EXIT/]
OHNO: AOSGE TRIES ; USED UP ALL THREE TRIES YET?
JRST AGAIN ; NO
PUSHJ PDP, MESSAG ; YES--INFORM USER OF FAILURE
ASCIZ /
TRANSMISSION ERROR--BLOCK WON'T LOAD
/
OUTPUT TTY,
CALLI 12 ; QUIT
AGAIN: PUSHJ PDP,MESSAG ; BLOCK BEING RELOADING
ASCIZ /
RELOADING BLOCK /
MOVE 0,BLK ; GET OCTAL BLOCK NUMBER
SETZ 1, ; NO BIT IN 0
ROTC ^D-12 ; 12 BITS IN 1
MOVEI 2,5 ; WORD COUNT
ROTC 3 ; GET DIGIT
SOS 2 ; SUB 1
CAIN 0,0 ; STRIP HIGH ORDER ZERO'S
JRST .-3 ; IS 0
PUSHJ PDP,ASC1 ; PRINT
SOJG 2,.-1 ; DONE WITH COUNT
MOVEI 0,40 ; SPACE
PUSHJ PDP,ASC2 ; OUTPUT SPACE
OUTPUT TTY,
SETZM TTYIN+2 ; IGNORE REST OF BUFFER
PUSHJ PDP,SIGGO
JRST LOOP+1
ASC1: ANDI 7 ; STRIP BITS
ADDI 60 ; ASCII
ASC2: PUSHJ PDP,OUT ; OUTPUT CHAR
ROTC 3 ; GET NEXT
POPJ PDP, ; RETURN
READ: SOSG TTYIN+2
INPUT TTY,
ILDB TTYIN+1
CAIN 15 ; CR?
POPJ PDP, ; YES--DO NOT
SUBI 40 ; FORM SIXBIT CODE
AOS (PDP)
POPJ PDP,
MESSAG: MOVEI 440700 ; SET UP POINTER IN PDL
HRLM (PDP)
JRST M2
M1: IDPB TTYOUT+1
M2: ILDB (PDP)
JUMPN M1 ; CHAR = 0?
AOS (PDP) ; YES--RETURN
POPJ PDP,
NOTFND: PUSHJ PDP, MESSAG
ASCIZ /
PROGRAM NOT FOUND
/
OUTPUT TTY,
JRST START
SIGGO: MOVEI 3
CALLI , 31
MOVEI 243 ;"#" TELL PDP11 TO GET READY
PUSHJ PDP,OUT
OUTPUT TTY,
POPJ PDP, ;BACK
;GET PDP11 BLOCK FROM PDP10 DISK
;
; AC 0,1,2,4,5 ARE USED THEY ALL CAN BE
; USED AFTER ROUTINE EXCEPT 5
BUILD: MOVEI 10
MOVNM TRIES# ; HAS THREE TRIES TO LOAD EACH BLOCK
SETZ 5,
AOS BLK
MOVE 2,[POINT 8,BUFF]
PUSHJ PDP,GETCHR ; START FRAME
CAIE 0,1 ; IS IT START FRAME ?
JRST .-2 ; NO,
IDPB 0,2 ; YES, SAVE IN BUFFER
PUSHJ PDP,GETCHR ; NULL FRAME
CAIE 0,0 ; IS IT NULL FRAME ?
JRST ERR+1 ; ERROR STOP
IDPB 0,2 ; YES, SAVE IN BUFFER
PUSHJ PDP,GETCHR ; LOW ORDER BYTE COUNT
IDPB 0,2 ; PUT IN BUFFER
MOVE 4,0 ; SAVE LOW ORDER BYTE COUNT
PUSHJ PDP,GETCHR ; HIGH ORDER BYTE COUNT
IDPB 0,2
ANDI 0,377 ; 8 BITS ONLY
LSH 0,+10 ; SHIFT TO HIGH ORDER
IORB 0,4 ; BYET COUNT IN 0
ADDI 4,1
CAIN 0,6
TRO 5,EOFSW
TRNE 5,EOFSW
ADDI 4,1
MOVEM 4,COUNT2
ADDI 0,1
IDIVI 0,3
CAIE 1,0
AOJ 0,
MOVEM 0,COUNT1
IMULI 0,3
SUBI 0,4
MOVE 6,0
PUSHJ PDP,GETCHR
IDPB 0,2 ; SAVE IN BUFFER
SOSE 6
JRST .-3 ; GET MORE DATA
POPJ PDP, ; BACK
TTYOUT: BLOCK 3
TTYIN: BLOCK 3
DSKIN: BLOCK 3
NAME: BLOCK 4
COUNT1: 0
COUNT2: 0
PDLIST: BLOCK 17
BLK: 0 ; OCTAL PDP-11 BLOCK NUMBER
BUFF: BLOCK 1000
END START