Trailing-Edge
-
PDP-10 Archives
-
decus_20tap4_198111
-
decus/20-0125/init.mac
There are 2 other files named init.mac in the archive. Click here to see a list.
TITLE INIT - INITIALIZE GT40
INTERN INIT
;
; THIS SUBROUTINE TRANSFERS A MACRO/11
; PROGRAM TO THE GT40 VIA THE GT40
; BOOTSTRAP. NOTE THAT THIS IS AN
; ENCODED SIX BIT TRANSFER
;
EXTERN SNDCHR
;
T0=0
T1=1
L=16
P=17
BYTEP: POINT 7,PROGRM
SAVET1: EXP 0 ; TEMP. STORAGE
;
INIT: SKIPA ; F40 AND
PUSH P,L ; FORTRAN-10 COMPATIBLE
MOVEI L,ARGBLK ; SET UP ARG. POINTER
MOVEI T1,^D255 ; 255 BYTES TO SEND
LOOP: ILDB T0,BYTEP ; GET THE NEXT BYTE
MOVEM T0,CHAR ; AND SAVE IN ARGUMENT
MOVEM T1,SAVET1 ; SAVE COUNT REGISTER
PUSHJ P,SNDCHR ; SEND THE CHARACTER
MOVE T1,SAVET1 ; RESTORE COUNT
SOJG T1,LOOP ; LOOP FOR ALL BYTES
POPJ P, ; RETURN TO FORTRAN
CHAR: EXP 0
XWD -1,0 ; ARGUMENT BLOCK
ARGBLK: EXP CHAR
PAGE
; THE MACRO/11 HANDLER (GT40 RESIDENT)
;
PROGRM: EXP 766457546200
ASCII '@@@@@@@@PB(@E0?1!U\O<BUT '
ASCII 'C7BXX@@P+7BV8@0@+;@/\IY C'
ASCII '@"?\B=0%^@@HP=0%X@L@@@%C7'
ASCII 'BU@@@1C7BT(@0@@CTLK%A @JA'
ASCII 'P8C=0$:@ANP0 +;A/\IL@CA"='
ASCII ' C0IUE@O\IM CW@_\IG CA"?\'
ASCII 'B03TA@@TC0IUH@O\IG @@@LBU'
ASCII 'T0C7BQP@R0C_"8#;?XC@%8+;0'
ASCII 'DT@?0E !0C@QPC?G9BN>=>K#O'
ASCII '/= H\@% @@@P@F@E0?W @@@@@'
PAGE
; MACRO/11 SOURCE (GTLOAD.P11)
; .TITLE GTLOAD GT40 LOAD HANDLER
;CHAR=%0
;CSUM=%1
;BYTECT=%2
;LOADDR=%3
;SP=%6
;PC=%7
; ;
;GTIS=175610 ; GT40 INPUT STATUS
;GTIB=175612 ; GT40 INPUT BUFFER
;GTOS=175614 ; GT40 OUTPUT STATUS
;GTOB=175616 ; GT40 OUTPUT BUFFER
; ;
; ; THIS IS THE GT40 RESIDENT HANDLER DURING
; ; A LOAD. THIS PROGRAM WOULD BE LOADED
; ; BY THE GT40 BOOTSTRAP (A SIX BIT LOADER)
; ; THIS IS AN EIGHT HANDLER SO TRANSFER
; ; IS SPEEDED UP. THE SECOND ADVANTAGE OF
; ; THIS HANDLER IS THAT IT RETURNS INFORMATION
; ; ABOUT EACH BLOCK, ALLOWING THE HOST (I.E. PDP 10)
; ; BETTER MONITORING OF BLOCK TRANSFERS
; ;
; .=37534 ; FOR 8K GT40
; ;
;START: MOV #START,SP ; SET UP STACK
;READY: MOVB #'R,CHAR ; 'R'
; JSR PC,SEND ; FOR READY
;GETBLK: CLR CSUM ; CLEAR THE CHECKSUM
; JSR PC,GET ; GET THE FIRST BYTE
; DEC CHAR ; IF NOT A 1 THEN
; BNE GETBLK ; LOOK FOR START
; JSR PC,GET ; GET THE SECOND BYTE
; TSTB CHAR ; IF NOT A NULL THEN
; BNE GETBLK ; LOOK FOR START
; ;
; ; START PROCESSING A VALID BLOCK
; ;
; JSR PC,GET ; GET LOW ORDER BYTE COUNT
; MOV CHAR,BYTECT ; AND SAVE
; JSR PC,GET ; GET HIGH ORDER BYTE COUNT
; SWAB CHAR ; MAKE HIGH ORDER
; BIS CHAR,BYTECT ; FORM COMPLETE BYTE COUNT
; JSR PC,GET ; GET LOW ORDER LOAD ADDRESS
; MOV CHAR,LOADDR ; AND SAVE
; JSR PC,GET ; GET HIGH ORDER LOAD ADDRESS
; SWAB CHAR ; MAKE HIGH ORDER
; BIS CHAR,LOADDR ; FORM COMPLETE LOAD ADDRESS
; ;
; ; IF BYTECT > 6 THEN INTERMEDIATE BLOCK
; ; IF BYTECT = 6 THEN LAST BLOCK
; ; IF BYTECT < 6 THEN ERROR
; ;
; SUB #6,BYTECT ; UPDATE BYTE COUNT
; BLT ERROR ; BAD COUNT
; BEQ LAST ; LAST BLOCK
; ;
; ; PROCESS INTERMEDIATE BLOCK
; ;
;NORMAL: JSR PC,GET ; GET THE NEXT BYTE
; MOVB CHAR,(LOADDR)+ ; SAVE THE BYTE, INCREMENT ADDRESS
; DEC BYTECT ; DECREMENT THE BYTE COUNT
; BGT NORMAL ; AND LOOP FOR ENTIRE BLOCK
; JSR PC,GET ; GET THE CHECKSUM
; TSTB CSUM ; IS CHECKSUM ZERO
; BEQ READY ; IF SO CONTINUE WITH NEXT BLOCK
; ;
; ; CHECKSUM ERROR OR BAD BYTE COUNT
; ;
;ERROR: MOVB #'E,CHAR ; 'E'
; JSR PC,SEND ; FOR ERROR
; BR GETBLK ; TRY THE BLOCK AGAIN
; ;
;LAST: JSR PC,GET ; GET THE CHECKSUM
; TSTB CSUM ; WAS IT GOOD ?
; BNE ERROR ; CHECKSUM ERROR
; ;
; ; SELF START OR HALT
; ;
; BIT #1,LOADDR ; EVEN ADDRESS ?
; BEQ TRANSF ; YES
; MOVB #'H,CHAR ; IF ODD THEN 'H'
; JSR PC,SEND ; FOR HALT
; HALT
;TRANSF: MOVB #'S,CHAR ; EVEN ADDRESS SO 'S'
; JSR PC,SEND ; FOR SELF-START
; JMP @LOADDR ; START USERS PROGRAM
PAGE
; .PAGE
;GET: TSTB @#GTIS ; TEST STATUS - READY ?
; BPL GET ; WAIT UNTIL READY
; MOVB @#GTIB,CHAR ; GET THE CHARACTER
; BIC #177400,CHAR ; CLEAR THE TOP BYTE
; ADD CHAR,CSUM ; AND ADD INTO CHECKSUM
; RTS PC ; RETURN TO CALLER
; ;
;SEND: BIC #177400,CHAR ; CLEAR TOP BYTE OF CHARACTER
; MOVB CHAR,@#GTOB ; SEND THE CHARACTER
;WAIT: TSTB @#GTOS ; WAIT UNTIL CHARACTER
; BPL WAIT ; HAS BEEN SENT
; RTS PC ; RETURN TO CALLER
; ;
; .END START
END