; This utility patches a prepared 16K SIO driver ; to use other slots, new version 6/13/11 ; does not depend on exact locations/instructions ; just the ranges... ; PTP 37135-37236, PTR 37236-37404, TTY 37405-37677 ; If needed other ranges can be patched using IOPATCH OCTAL DEFINE ISIO ; value ISIO - pushes 1 if an IO instruction else pushes 0 177700 AND ;mask off slot DUP 102000 SUB IFZ DROP #0 ENDIF ;ignore halts 177000 AND ;mask to xxx000 CASE = 102000 #1 = 103000 #1 = 106000 #1 DEFAULT #0 ENDCASE END DEFINE IOPATCH ; from to slot IOPATCH - changes IO instructions in range ; only for simple stuff - no control words S>Y ;save slot +DO ;loop through range INDEX 150 #1 A>CCOPY 150 GET ISIO IFNZ ;if an IO instruction INDEX PNUM ;print address 150 DUP GET 177700 AND Y>S DUP S>Y OR PUT ;merge new slot 150 INDEX #1 C>ACOPY ;copy back to alt mem ENDIF +LOOP Y>S DROP END DEFINE SIOPATCH "Attach old sio to PTR, new sio to PTP" $PRINT CRLF "Press enter when ready..." $PRINT $IN $DROP ZAM ABSLOAD CRLF 37136 150 #1 A>CCOPY 150 GET IFZ "Not a sio binary" $PRINT ELSE "TTY? " $PRINT $IN $VAL 151 SWAP PUT "PTR? " $PRINT $IN $VAL 152 SWAP PUT "PTP? " $PRINT $IN $VAL 153 SWAP PUT "Patching TTY..." $PRINT CRLF 37405 37677 151 GET IOPATCH CRLF "Patching PTR..." $PRINT CRLF 37236 37404 152 GET IOPATCH CRLF "Patching PTP..." $PRINT CRLF 37136 37235 153 GET IOPATCH CRLF "Writing new sio binary..." $PRINT PTZERO 4 5 AAOUT 101 106 AAOUT 37135 37677 AAOUT PTZERO CRLF "Done" $PRINT ENDIF END CONSOLE