.TITLE TOKN .NLIST SYM .ENABL AMA .PSECT TOKN TOKN1:: MOV @4(R5),R0 ;addr of string out ADD #6.,R0 ;move to the 4'th word and MOV R0,(R0) ;store the current output location ADD #6,(R0)+ ;there. and the 5'th word is used CLR (R0) ;to count how many tokens placed RTS PC ;in the string array TOKN2:: MOV R1,-(SP) ;save MOV R3,-(SP) MOV @4(R5),R1 ;get output location INC 10(R1) ;r0=addr and r2=len MOV 6(R1),R3 ;count tokens ADD R2,R3 ;and update to next slot for INC R3 ;next entry MOV R3,6(R1) ; mov r3,-(sp) ;compute too long a line sub (r1),(sp) ; cmp (sp)+,r1 blo 5$ mov #5,r1 ;call it a too long error jsr pc,err.check ;and see that it is logged br 15$ ;on the terminal 5$: SUB R2,R3 ;put the length into the MOVB R2,-1(R3) ;output tst r2 Ble 15$ ;test for zero 10$: MOVB (R0)+,(R3)+ ;and copy in the stuff SOB R2,10$ 15$: MOV (SP)+,R3 MOV (SP)+,R1 RTS PC TOKN3:: MOV R0,-(SP) ;here we add enough nulls to MOV R1,-(SP) ;the end so the array is nulled MOV R2,-(SP) ;out on the end MOV @4(R5),R0 ADD #6.,R0 MOV (R0),R1 MOV #255.,(R0)+ MOV 2(R0),R2 SUB (R0),R2 CLR (R0) TST R2 BLE 10$ 5$: CLRB (R1)+ SOB R2,5$ 10$: MOV (SP)+,R2 MOV (SP)+,R1 MOV (SP)+,R0 RTS PC TOKN4:: MOV R1,-(SP) MOV R3,-(SP) MOV 6(SP),R1 ;here we are moving the token MOV R1,R3 ;into a string array so it ADD #12.,R3 ;can be sent through MOV R2,(R3) ;the statement routine. ADD #2,(R3) INC R3 MOVB #'$,(R3)+ MOVB (R0),(R3)+ CMPB (R0),#177 BNE 5$ MOVB #QUOTE,-1(R3) MOVB #40,(R3)+ MOVB #LESSTHAN,(R0) BR 55$ 5$: MOVB #40,(R0) 55$: TST R2 Ble 15$ 10$: MOVB (R0)+,(R3)+ SOB R2,10$ 15$: MOV (SP)+,R3 MOV (SP)+,R1 MOV (SP),2(SP) TST (SP)+ RTS PC SKIPB:: ;INPUT IS R0 -> LINE MOV R1,-(SP) MOVB -1(R0),R1 BIC #177400,R1 TST R1 BEQ 15$ 10$: CMPB (R0)+,#40 BEQ 12$ CMPB -1(R0),#11 BEQ 12$ DEC R0 BR 15$ 12$: SOB R1,10$ 15$: MOV (SP)+,R1 RTS PC .END