.TITLE CRTRUB SCOPE TYPE DETERMINATION, TABLES, SEQUENCES .NLIST TTM .LIST TOC,MEB,BEX .ENABL REG,GBL .SBTTL SCOPE TYPE DETERMINATION, TABLES, SEQUENCES ; LAST EDIT ON 12-APR-79 BY MARK BRAMHALL .IDENT /V24/ .SBTTL ASSEMBLY PARAMETERS ; RSTS ASSEMBLE FOR RSTS/E SCOPE TYPE DETERMINATION (D=NO) ; RSX ASSEMBLE FOR RSX-11 SCOPE TYPE DETERMINATION (D=NO) ; VMS ASSEMBLE FOR VAX/VMS SCOPE TYPE DETERMINATION (D=NO) ; RT11 ASSEMBLE FOR RT-11 SCOPE TYPE DETERMINATION (D=NO) ; NOTE: YOU MUST SELECT EXACTLY ONE OPERATING SYSTEM FROM THE FOUR ABOVE. ; WATCH ASSEMBLE TO INCLUDE "WATCH" SUPPORT (D=YES) ; I$$SOB ASSEMBLE FOR HARDWARE 'SOB' INSTRUCTION (D=NO) ; I$$DIV ASSEMBLE FOR HARDWARE 'DIV' INSTRUCTION (D=NO) .SBTTL DEFAULT AND SET UP THE ASSEMBLY PARAMETERS .IIF NDF RSTS, RSTS=0 ;DEFAULT TO NOT RSTS/E .IIF NDF RSX, RSX=0 ;DEFAULT TO NOT RSX-11 .IIF NDF VMS, VMS=0 ;DEFAULT TO NOT VAX/VMS .IIF NDF RT11, RT11=0 ;DEFAULT TO NOT RT-11 $$$$$$ = 0 .IF NE RSTS $$$$$$ = $$$$$$+1 .SBTTL ASSEMBLED FOR RSTS/E SCOPE TYPE DETERMINATION .ENDC ;NE RSTS .IF NE RSX $$$$$$ = $$$$$$+1 .SBTTL ASSEMBLED FOR RSX-11 SCOPE TYPE DETERMINATION .ENDC ;NE RSX .IF NE VMS $$$$$$ = $$$$$$+1 .SBTTL ASSEMBLED FOR VAX/VMS SCOPE TYPE DETERMINATION .ENDC ;NE VMS .IF NE RT11 $$$$$$ = $$$$$$+1 .SBTTL ASSEMBLED FOR RT-11 SCOPE TYPE DETERMINATION .ENDC ;NE RT11 .IF NE $$$$$$-1 .ERROR ;NO OR MORE THAN ONE SCOPE TYPE DETERMINATION ROUTINE SPECIFIED .ENDC ;NE $$$$$$-1 .IIF NDF WATCH, WATCH=1 ;DEFAULT TO INCLUDING "WATCH" SUPPORT .IF NE WATCH .SBTTL ASSEMBLED TO INCLUDE "WATCH" SUPPORT .IFF ;NE WATCH .SBTTL ASSEMBLED TO NOT INCLUDE "WATCH" SUPPORT .ENDC ;NE WATCH .IIF NDF I$$SOB, I$$SOB=0 ;DEFAULT TO NO HARDWARE 'SOB' .IF EQ I$$SOB .MACRO SOB REG,DST DEC REG BNE DST .ENDM SOB .SBTTL ASSEMBLED WITHOUT HARDWARE 'SOB' INSTRUCTION .IFF ;EQ I$$SOB .SBTTL ASSEMBLED WITH HARDWARE 'SOB' INSTRUCTION .ENDC ;EQ I$$SOB .IIF NDF I$$DIV, I$$DIV=0 ;DEFAULT TO NO HARDWARE 'DIV' .IF EQ I$$DIV .MACRO DIVR0 AMT MOV AMT,R0 JSR PC,DIVR0 .ENDM DIVR0 .SBTTL ASSEMBLED WITHOUT HARDWARE 'DIV' INSTRUCTION .IFF ;EQ I$$DIV .MACRO DIVR0 AMT CLR R0 DIV AMT,R0 .ENDM DIVR0 .SBTTL ASSEMBLED WITH HARDWARE 'DIV' INSTRUCTION .ENDC ;EQ I$$DIV .SBTTL NECESSARY SEQUENCES FOR RUBOUT AND CONTROL/U .PSECT CRTRUB,RO,I,GBL,REL,OVR CRTRUB: .WORD CRTSET ;ADDRESS OF THE SET UP ROUTINE .ENABL LSB .IIF NE .-CRTRUB-2, .ERROR ;CURSOR UP SEQUENCE IS INCORRECTLY LOCATED CUPSEQ: .WORD 10$,10$,30$,50$ ;CURSOR UP SEQUENCE POINTERS .IIF NE .-CRTRUB-12, .ERROR ;ERASE SEQUENCE IS INCORRECTLY LOCATED ERLSEQ: .WORD 20$,20$,40$,60$ ;ERASE A WHOLE LINE SEQUENCE POINTERS 10$: .BYTE 2,233,'A ;VT52 & VT100(VT52) => 20$: .BYTE 4,015 ;VT52 & VT100(VT52) => ENSURE LEFT MARGIN .BYTE 233,'K ; .BYTE 015 ; ENSURE LEFT MARGIN 30$: .BYTE 5,233,'< ;VT100(ANSI) => ENSURE ANSI MODE .BYTE 233,'[,'A ; <[> 40$: .BYTE 7,015 ;VT100(ANSI) => ENSURE LEFT MARGIN .BYTE 233,'< ; ENSURE ANSI MODE .BYTE 233,'[,'K ; <[> .BYTE 015 ; ENSURE LEFT MARGIN 50$: .BYTE 5,232,0,0,0,0 ;VT05 => 60$: .BYTE 3,015,236,015 ;VT05 => .EVEN .DSABL LSB .SBTTL DETERMINE SCOPE TYPE ;+ ; CRTSET - DETERMINE SCOPE TYPE. ; ;*RSTS* R4 -> FIRQB @ +6 WITH CHARACTERISTICS (UU.TRM) OF SCOPE TERMINAL ;*RSX* R4 -> HORIZONTAL SIZE AS A BYTE OF SCOPE TERMINAL ;*VMS* R4 -> DEVICE INFORMATION BUFFER @ +6 (DIB$) OF SCOPE TERMINAL ;*RT11* R4 -> TERMINAL STATUS BLOCK @ +6 (M.TWID) OF SCOPE TERMINAL ; CRTYPE(R5) = -1 (I.E., PRE-SET FOR NO SCOPE SUPPORT) ; ; JSR PC,@CRTRUB (I.E., JSR PC,CRTSET) ; ; R4 = SIZE OF "WATCH" STATIC READ/WRITE REGION (0 => NONE) ; CRTYPE(R5) = -1 FOR NO SCOPE SUPPORT ; 0 FOR SCOPE SUPPORT TYPE #1 (VT52) ; 2 FOR SCOPE SUPPORT TYPE #2 (VT100 IN VT52 MODE) ; 4 FOR SCOPE SUPPORT TYPE #3 (VT100 IN ANSI MODE) ; 6 FOR SCOPE SUPPORT TYPE #4 (VT05) ; VTSIZE+RWSIZE(R5) = VERTICAL SIZE IF "WATCH" SUPPORT (10.-127.) ; HTSIZE+RWSIZE(R5) = HORIZONTAL SIZE IF "WATCH" SUPPORT (10.-254.&EVEN) ; "ET$CRT" SET IN "ETYPE(R5)" IF SCOPE SUPPORTED FOR RUBOUT & CONTROL/U ; "ET$IAS" SET IN "ETYPE(R5)" IF SCOPE SUPPORTED FOR "WATCH" ;- CRTSET: MOV R0,-(SP) ;SAVE R0 MOV #6,R0 ;PRESET SCOPE TYPE TO 6 .IF NE RSTS DECB (R4) ;FORM THE TRUE HORIZONTAL SIZE CMPB (R4),#72. ;IS SCOPE A VT05 (WIDTH = 72.)? BEQ 40$ ;YES CMPB (R4),#132. ;IS SCOPE A VT100 IN ANSI MODE (WIDTH = 132.)? BEQ 30$ ;YES CMPB (R4),#80. ;IS SCOPE A VT52 (WIDTH = 80.)? BNE 10$ ;NO, BUT GIVE USER SCOPE SUPPORT FOR A VT52... INCB 12-6(R4) ;REALLY A VT100 IN VT52 MODE ("XON")? BEQ 20$ ;YES, USE IT IN VT52 MODE... .ENDC ;NE RSTS .IF NE RSX CMPB (R4),#72. ;IS SCOPE A VT05 (WIDTH = 72.)? BEQ 40$ ;YES CMPB (R4),#132. ;IS SCOPE A VT100 IN ANSI MODE (WIDTH = 132.)? BEQ 30$ ;YES ;CMPB (R4),#80. ;IS SCOPE A VT52 (WIDTH = 80.)? ;BNE 10$ ;NO, BUT GIVE USER SCOPE SUPPORT FOR A VT52... ;??? ;REALLY A VT100 IN VT52 MODE ("???")? ;B?? 20$ ;YES, USE IT IN VT52 MODE... .ENDC ;NE RSX .IF NE VMS CMPB 5-6(R4),#1 ;IS SCOPE A VT05 (TT$_VT05 = ^X1)? BEQ 40$ ;YES CMPB 5-6(R4),#65. ;IS SCOPE A VT55 (TT$_VT55 = ^X41)? BEQ 10$ ;YES, GO PRETEND IT'S A VT52 CMPB 5-6(R4),#64. ;IS SCOPE A VT52 (TT$_VT52 = ^X40)? BEQ 10$ ;YES CMPB 5-6(R4),#80. ;IS SCOPE A VT100 (TT$_VT100 = ^X50)? BNE 10$ ;NO, BUT GIVE USER SCOPE SUPPORT FOR A VT52... CMPB (R4),#132. ;YES, IS IT IN ANSI MODE (WIDTH = 132.)? BEQ 30$ ;YEP BR 20$ ;NOPE, USE IT IN VT52 MODE... .ENDC ;NE VMS .IF NE RT11 CMPB (R4),#72. ;IS SCOPE A VT05 (WIDTH = 72.)? BEQ 40$ ;YES CMPB (R4),#132. ;IS SCOPE A VT100 IN ANSI MODE (WIDTH = 132.)? BEQ 30$ ;YES CMPB (R4),#80. ;IS SCOPE A VT52 (WIDTH = 80.)? BNE 10$ ;NO, BUT GIVE USER SCOPE SUPPORT FOR A VT52... MOV #7400,-(SP) ;REALLY A VT100 IN VT52 MODE? BIC 0-6(R4),(SP)+ ;FAKE SPEED OF 19.2KB SET IF SO... BEQ 20$ ;YES, USE IT IN VT52 MODE... .ENDC ;NE RT11 10$: TST -(R0) ;CHANGE SCOPE TYPE TO 0 (VT52) 20$: TST -(R0) ;CHANGE SCOPE TYPE TO 2 (VT100 IN VT52 MODE) 30$: TST -(R0) ;CHANGE SCOPE TYPE TO 4 (VT100 IN ANSI MODE) 40$: MOV R0,CRTYPE(R5) ;SET THE SCOPE TYPE BIS #ET$CRT,ETYPE(R5) ; AND ENABLE SCOPE RUBOUT SUPPORT .IF NE WATCH MOV 60$(R0),VTSIZE+RWSIZE(R5) ;SAVE VERTICAL SIZE FOR "WATCH" MOV 70$(R0),R0 ;GET HORIZONTAL SIZE FOR "WATCH" BNE 50$ ;SPECIFIC HORIZONTAL SIZE SET MOVB (R4),R0 ;ELSE GET ACTUAL HORIZONTAL SIZE BIC #^C<376>,R0 ;ENSURE IT IS EVEN AND LIMIT IT TO A BYTE CMP R0,#10. ;IS IT AT LEAST 10.? BHIS 50$ ;ACTUAL SIZE IS O.K. MOV #80.,R0 ;NO GOOD, DEFAULT HORIZONTAL SIZE TO 80. 50$: MOV R0,HTSIZE+RWSIZE(R5) ;SET HORIZONTAL SIZE FOR "WATCH" BIS #ET$IAS,ETYPE(R5) ;ENABLE "WATCH" SUPPORT MOV #SRWSIZ,R4 ; AND SET SIZE OF STATIC READ/WRITE REGION .IFTF ;NE WATCH MOV (SP)+,R0 ;RESTORE R0 RTS PC ; AND EXIT .IFT ;NE WATCH 60$: .WORD 24.,24.,24.,20. ;TABLE OF VERTICAL SIZES 70$: .WORD 80.,80., 0 ,72. ;TABLE OF HORIZONTAL SIZES .ENDC ;NE WATCH .IF NE WATCH .SBTTL NECESSARY TABLES AND SEQUENCES FOR "WATCH" SUPPORT .PSECT SCRSEQ,RO,D,GBL,REL,CON ; POSTBL - TABLE OF NUMBER OF CHARACTERS NEEDED TO POSITION CURSOR. ; ; THIS TABLE IS USED FOR A CURSOR MOVEMENT OPTIMIZATION: ; IF THE NUMBER OF PLACES TO MOVE THE CURSOR RIGHT (ON THE ; SAME LINE) IS LESS THAN THIS TABLE'S ENTRY, THEN THE ; PRECEEDING TEXT CHARACTERS ARE OUTPUT INSTEAD. THIS ENSURES ; THAT WE ARE ALWAYS SENDING THE MINIMAL NUMBER OF CHARACTERS ; TO THE SCREEN. POSTBL::.WORD 4 ; .WORD 4 ; .WORD 4 ;<[><# MOVES> .WORD 7 ;<4 FILL'S> ; FIXSEQ - CLEAN UP MODES (IF ANY). FIXSEQ::.WORD 10$,10$,20$,NULL ;CLEAN UP MODES (IF ANY) 10$: .BYTE 033,'[,'?,'2,'L+40 ;ENSURE VT52 MODE .BYTE 033,'\ ;EXIT HOLD SCREEN MODE (IF ON) .BYTE 033,'G,200 ;EXIT GRAPHICS MODE (IF ON) 20$: .BYTE 033,'< ;ENSURE ANSI MODE .BYTE 033,'[,'M+40 ;TURN OFF ALL CHARACTER ATTRIBUTES .BYTE 033,'[,'2,'0,'L+40 ;ENSURE LINE FEED MODE .BYTE 033,'[,'?,'6 ;ENSURE ORIGIN MODE .BYTE ';,'7,'L+40 ; AND AUTO WRAP ARE OFF .BYTE 017 ;EXIT GRAPHICS MODE (IF ON) .BYTE 033,'),'0,200 ;SET GRAPHICS MODE TO GRAPHICS CHARACTER SET .EVEN ; HOMSEQ - GO TO HOME. HOMSEQ::.WORD 10$,10$,20$,30$ ;GO TO HOME 10$: .BYTE 033,'H,200 ;GO TO HOME 20$: .BYTE 033,'[,'H,200 ;GO TO HOME 30$: .BYTE 035 ;GO TO HOME FILL4: .BYTE 0,0,0,0 ;4 FILL'S NULL: .BYTE 200 ;NULL SEQUENCE .EVEN ; EOLSEQ - ERASE FROM CURSOR TO END OF LINE. EOLSEQ::.WORD 10$,10$,20$,30$ ;ERASE FROM CURSOR TO END OF LINE 10$: .BYTE 033,'K,200 ;ERASE FROM CURSOR TO END OF LINE 20$: .BYTE 033,'[,'K,200 ;ERASE FROM CURSOR TO END OF LINE 30$: .BYTE 036,200 ;ERASE FROM CURSOR TO END OF LINE .EVEN ; EOSSEQ - ERASE FROM CURSOR TO END OF SCREEN. EOSSEQ::.WORD 10$,10$,NULL,20$ ;ERASE FROM CURSOR TO END OF SCREEN 10$: .BYTE 033,'J,200 ;ERASE FROM CURSOR TO END OF SCREEN 20$: .BYTE 037,0,0,0,0,200 ;ERASE FROM CURSOR TO END OF SCREEN & 4 FILL'S .EVEN ; SCUSEQ - SCROLL SCREEN UP (WITH CURSOR AT LOWER LEFT). SCUSEQ::.WORD 10$,10$,10$,20$ ;SCROLL SCREEN UP 10$: .BYTE 012,200 ;SCROLL SCREEN UP 20$: .BYTE 012,0,0,0,0,200 ;SCROLL SCREEN UP & 4 FILL'S .EVEN ; SCDSEQ - SCROLL SCREEN DOWN (WITH CURSOR AT UPPER LEFT). SCDSEQ::.WORD 10$,10$,20$,NULL ;SCROLL SCREEN DOWN 10$: .BYTE 033,'I,200 ;SCROLL SCREEN DOWN 20$: .BYTE 033,'M,200 ;SCROLL SCREEN DOWN .EVEN ; GONSEQ - TURN ON GRAPHICS MODE. GONSEQ::.WORD 10$,10$,20$,NULL ;TURN ON GRAPHICS MODE 10$: .BYTE 033,'F,200 ;TURN ON GRAPHICS MODE 20$: .BYTE 016,200 ;TURN ON GRAPHICS MODE .EVEN ; GOFSEQ - TURN OFF GRAPHICS MODE. GOFSEQ::.WORD 10$,10$,20$,NULL ;TURN OFF GRAPHICS MODE 10$: .BYTE 033,'G,200 ;TURN OFF GRAPHICS MODE 20$: .BYTE 017,200 ;TURN OFF GRAPHICS MODE .EVEN ; MONSEQ - TURN ON MARK'D REGION MODE. MONSEQ::.WORD NULL,NULL,10$,NULL ;TURN ON MARK'D REGION MODE 10$: .BYTE 033,'[,'7,'M+40,200 ;SET REVERSE VIDEO ATTRIBUTE .EVEN ; MOFSEQ - TURN OFF MARK'D REGION MODE. MOFSEQ::.WORD NULL,NULL,10$,NULL ;TURN OFF MARK'D REGION MODE 10$: .BYTE 033,'[,'M+40,200 ;CLEAR ALL ATTRIBUTES .EVEN ; GRPTBL - TABLE OF GRAPHICS MODE CHARACTERS. ; ; EACH TABLE CONTAINS 11. BYTES CORRESPONDING TO THE GRAPHICS ; MODE CHARACTERS FOR: ; ; 1) A LINE WHICH OVERFLOWS THE SCREEN'S WIDTH ; 2) CURSOR POSITIONED ON IMMEDIATELY AFTER ; ALSO, "SEE ALL" MODE SYMBOL FOR ; 3) "SEE ALL" MODE SYMBOL FOR CONTROL CHARACTER FLAG ; 4) "SEE ALL" MODE SYMBOL FOR ; 5) AT END OF BUFFER ENDING WITHOUT ; 6) AT END OF BUFFER ENDING WITH ; ALSO, "SEE ALL" MODE SYMBOL FOR ; 7) "SEE ALL" MODE SYMBOL FOR ; 8) "SEE ALL" MODE SYMBOL FOR NULL SPACING ; 9) "SEE ALL" MODE SYMBOL FOR ; 10) "SEE ALL" MODE SYMBOL FOR OVERPRINT ; 11) "SEE ALL" MODE SYMBOL FOR GRPTBL::.WORD 10$,20$,20$,30$ ;TABLE OF GRAPHICS CHARACTERS 10$: .BYTE 'H+40 ;RIGHT ARROW .BYTE 'K+40 ;DOWN ARROW .BYTE 'G+40 ;PLUS OR MINUS .BYTE 'J+40 ;DIVIDED BY .BYTE '^+40 ;PARAGRAPH .BYTE 'A+40 ;SOLID RECTANGLE .BYTE 'F+40 ;DEGREES .BYTE 'I+40 ;ELIPSIS .BYTE '@+40 ;"CD" .BYTE 'D+40 ;"5/" .BYTE 'C+40 ;"3/" 20$: .BYTE 'H+40 ;"NL" .BYTE 'E+40 ;"LF" .BYTE 'G+40 ;PLUS OR MINUS .BYTE 'I+40 ;"VT" .BYTE '@+40 ;DIAMOND .BYTE 'C+40 ;"FF" .BYTE 'B+40 ;"HT" .BYTE '^+40 ;CENTERED DOT .BYTE 'D+40 ;"CR" .BYTE '\+40 ;NOT EQUALS .BYTE '[+40 ;PI 30$: .BYTE '+ ;+ .BYTE '' ;' .BYTE '^ ;NO GRAPHICS... .BYTE 040 ;NO GRAPHICS... .BYTE '% ;% .BYTE '@ ;@ .BYTE 040 ;NO GRAPHICS... .BYTE 040 ;NO GRAPHICS... .BYTE 040 ;NO GRAPHICS... .BYTE 040 ;NO GRAPHICS... .BYTE '$ ;NO GRAPHICS... .EVEN .SBTTL NECESSARY SUBROUTINE FOR "WATCH" SUPPORT .PSECT SCRSUB,RO,I,GBL,REL,CON ;+ ; DIRECT - DO DIRECT CURSOR ADDRESSING. ; ; R0 = DESIRED LINE NUMBER (ROW), 0 BASED ; R2 = DESIRED COLUMN NUMBER, 0 BASED ; PRELIN+RWSIZE(R5) = CURRENT CURSOR LINE NUMBER (ROW), 0 BASED ; PRECOL+RWSIZE(R5) = CURRENT CURSOR COLUMN NUMBER, 0 BASED ; VTSIZE+RWSIZE(R5) = SCREEN'S VERTICAL SIZE ; HTSIZE+RWSIZE(R5) = SCREEN'S HORIZONTAL SIZE ; ; JSR PC,DIRECT ; ; R0 = UNDEFINED ; R3 = UNDEFINED ;- DIRECT::MOV R1,-(SP) ;SAVE R1 MOV CRTYPE(R5),R1 ;GET THE SCOPE TYPE SUB #4,R1 ;VT52=-4, VT100(VT52)=-2, VT100(ANSI)=0, VT05=2 MOV R0,-(SP) ;COPY DESIRED LINE NUMBER (ROW) SUB PRELIN+RWSIZE(R5),(SP) ; AND FIND # LINES (ROWS) TO MOVE BEQ 10$ ;NONE, LINE (ROW) IS ALREADY CORRECT CMP R2,PRECOL+RWSIZE(R5) ;SOME, IS COLUMN NUMBER ALREADY CORRECT? BNE 60$ ;NOPE, DO DIRECT CURSOR ADDRESSING MOV #200$,R3 ;SET SEQUENCE FOR CURSOR DOWN (& UP) TST (SP) ;CHECK THAT MOVEMENT DIRECTION BR 30$ ; AND GO USE IT 10$: CMP R1,#-4 ;CHECK FOR VT52 SCOPE TYPE BNE 20$ ;NOT A VT52 MOV #24.,R0 ;THIS IS TO HELP STOP VT52 FROM FLICKER... 20$: MOV #210$,R3 ;SET SEQUENCE FOR CURSOR RIGHT (& LEFT) MOV R2,(SP) ;COPY DESIRED COLUMN NUMBER SUB PRECOL+RWSIZE(R5),(SP) ; AND FIND # COLUMNS TO MOVE 30$: BPL 40$ ;WE NEED TO MOVE THE CURSOR DOWN -OR- RIGHT NEG (SP) ;CORRECT FOR A POSITIVE MOVEMENT AMOUNT ADD #10,R3 ; AND CHANGE TO CURSOR UP -OR- LEFT 40$: CMP (SP),220$+4(R1) ;WITHIN THE MAXIMUM RANGE? BHIS 60$ ;NOPE, DO DIRECT CURSOR ADDRESSING MOV (SP)+,R0 ;YEP, PUT THE COUNT INTO A REGISTER TST R1 ;VT100 IN ANSI MODE? BEQ 110$ ;YES, DO DIFFERENTLY 50$: JSR PC,DOTYPE ;DO 1 CURSOR DOWN/UP -OR- RIGHT/LEFT SOB R0,50$ ; AND LOOP... MOV (SP)+,R1 ;RESTORE R1 RTS PC ; AND EXIT 60$: TST (SP)+ ;JUNK THAT MOVEMENT AMOUNT MOV #230$,R3 ;SET SEQUENCE FOR DIRECT CURSOR ADDRESSING JSR PC,DOTYPE ; AND START DIRECT CURSOR ADDRESSING TST R1 ;VT100 IN ANSI MODE? BEQ 120$ ;YES, DO DIFFERENTLY JSR PC,90$ ;NO, ADJUST AND OUTPUT LINE NUMBER (ROW) TST R1 ;VT05 NEEDING FILL? BLE 70$ ;NOPE MOV #240$,R3 ;YEP, SET FILLER SEQUENCE JSR PC,DOTYPE ; AND GO DO IT 70$: MOV R2,R0 ;NOW SET COLUMN NUMBER 80$: MOV (SP)+,R1 ;RESTORE R1 90$: ADD #40,R0 ;ADJUST LINE (ROW) OR COLUMN NUMBER 100$: JMP TYPEBF ;OUTPUT CHARACTER, THEN EXIT 110$: MOV 4(R3),-(SP) ;STACK THE FINAL CHARACTER (LESS 40) MOV #230$,R3 ;SET START OF MOVE SEQUENCE JSR PC,DOTYPE ; AND GO DO IT MOV R0,R1 ;COPY THE MOVE COUNT DEC R1 ; MAKING IT 0 BASED BR 140$ ;NOW GO DO IT 120$: MOV #'H-40,-(SP) ;SET FINAL CHARACTER (LESS 40) MOV R0,R1 ;COPY THE LINE NUMBER (ROW) BEQ 130$ ;NO NEED FOR OUTPUT IF WOULD BE "1" JSR PC,160$ ;ELSE OUTPUT AS ASCII DIGITS 130$: MOV #';,R0 ;SET THE SEPERATOR JSR PC,TYPEBF ; AND OUTPUT IT MOV R2,R1 ;COPY THE COLUMN NUMBER 140$: BEQ 150$ ;NO NEED FOR OUTPUT IF WOULD BE "1" JSR PC,160$ ;ELSE OUTPUT AS ASCII DIGITS 150$: MOV (SP)+,R0 ;SET THE FINAL CHARACTER (LESS 40) BR 80$ ; AND GO EXIT OUTPUTTING FINAL 160$: INC R1 ;ANSI WANTS NUMBER "1" BASED DIVR0 #100. ;DIVIDE FOR HUNDREDS MOV R0,-(SP) ;SAVE HUNDREDS BEQ 170$ ;NO HUNDREDS, SO SKIP THEM JSR PC,190$ ;HUNDREDS, GO OUTPUT IT 170$: DIVR0 #10. ;DIVIDE FOR TENS BIS R0,(SP)+ ;DO TENS AND/OR HUNDREDS EXIST? BEQ 180$ ;NOPE JSR PC,190$ ;YEP, GO OUTPUT THE TENS 180$: MOV R1,R0 ;SET UNITS 190$: ADD #'0,R0 ;MAKE INTO AN ASCII DIGIT BR 100$ ; AND GO OUTPUT IT 200$: .WORD 250$,250$,'B-40,260$ ;CURSOR DOWN .WORD 270$,270$,'A-40,280$ ;CURSOR UP 210$: .WORD 290$,290$,'C-40,300$ ;CURSOR RIGHT .WORD 310$,310$,'D-40,320$ ;CURSOR LEFT 220$: .WORD <2+1+0+1>/2 ; VS. N*() .WORD <2+1+0+1>/2 ; VS. N*() .WORD -1 ;<[><;> VS. <[> .WORD <1+1+4+1>/1 ;<^N><0><0><0><0> VS. N*(<^X/BS>) 230$: .WORD 330$,330$,340$,350$ ;START DIRECT CURSOR ADDRESSING 240$: .WORD NULL,NULL,NULL,FILL4 ;FILL AS REQUIRED 250$: .BYTE 033,'B,200 ;VT52 & VT100 IN VT52 MODE => 260$: .BYTE 012,0,0,0,0,200 ;VT05 => & 4 FILL'S 270$: .BYTE 033,'A,200 ;VT52 & VT100 IN VT52 MODE => 280$: .BYTE 032,0,0,0,0,200 ;VT05 => & 4 FILL'S 290$: .BYTE 033,'C,200 ;VT52 & VT100 IN VT52 MODE => 300$: .BYTE 030,200 ;VT05 => 310$: .BYTE 033,'D,200 ;VT52 & VT100 IN VT52 MODE => 320$: .BYTE 010,200 ;VT05 => 330$: .BYTE 033,'Y,200 ;VT52 & VT100 IN VT52 MODE => 340$: .BYTE 033,'[,200 ;VT100 IN ANSI MODE => <[> 350$: .BYTE 016,200 ;VT05 => .EVEN .IF EQ I$$DIV DIVR0: MOV R0,-(SP) ;SAVE DIVISOR ON THE STACK MOV #-1,R0 ;PRE-SET BIASED RESULT 10$: INC R0 ;COUNT 1 MORE IN RESULT SUB (SP),R1 ; AND DO TRAIL SUBTRACT FROM DIVIDEND BHIS 10$ ;NO UNDERFLOW YET... ADD (SP)+,R1 ;UNDERFLOW, CORRECT REMAINDER RTS PC ; AND EXIT .ENDC ;EQ I$$DIV .ENDC ;NE WATCH .END