.TITLE VT .MCALL .PRINT ; ; These ".GLOBL" symbols indicate which labels may be ; called as Fortran subroutines ; .GLOBL SAVCUR,RESCUR,KPAM,KPNM,RIS,RI,ALIGND,BIGTOP,BIGBOT .GLOBL DWL,SWL,SGS,DGS,CLRALL,CLRTOP,CLRBOT,LL,CLRLIN .GLOBL CLRBEG,CLREND,NEGVID,POSVID,SM,RM,CUP,STBM,NEL,IND .GLOBL CUU,CUD,CUF,CUB,ANSI,CRLF .ENABL LC ; ;********************************************************************** ; SAVCUR: MOV #MSG2-1,R2 ;SAVe CURsor & attributes MOVB #'7,2(R2) JMP PRINT2 ; RESCUR: MOV #MSG2-1,R2 ;REStore CURsor & attributes MOVB #'8,2(R2) JMP PRINT2 ; KPAM: MOV #MSG2-1,R2 ;KeyPad Application Mode MOVB #'=,2(R2) JMP PRINT2 ; KPNM: MOV #MSG2-1,R2 ;KeyPad Numeric Mode MOVB #'>,2(R2) JMP PRINT2 ; RIS: MOV #MSG2-1,R2 ;Reset to Initial State MOVB #'c,2(R2) JMP PRINT2 ; RI: MOV #MSG2-1,R2 ;Reverse Index (move up) MOVB #'M,2(R2) JMP PRINT2 ; NEL: MOV #MSG2-1,R2 ;NEw Line MOVB #'E,2(R2) JMP PRINT2 ; IND: MOV #MSG2-1,R2 ;INDex (move down) MOVB #'D,2(R2) JMP PRINT2 ; ANSI: MOV #MSG2-1,R2 ;set ANSI mode MOVB #'<,2(R2) JMP PRINT2 ; PRINT2: .PRINT #MSG2 RTS PC MSG2: .ASCII <33>/8/<200> .EVEN ; CRLF: .PRINT #MSG2A RTS PC MSG2A: .ASCII <15><12><200> .EVEN ; ;*********************************************************************** ; ALIGND: MOV #MSG3-1,R2 ;ALIGN Display (fill screen with E's) MOVB #'8,3(R2) JMP PRINT3 ; BIGTOP: MOV #MSG3-1,R2 ;BIG TOP (of double height line) MOVB #'3,3(R2) JMP PRINT3 ; BIGBOT: MOV #MSG3-1,R2 ;BIG BOTtom (of double height line) MOVB #'4,3(R2) JMP PRINT3 ; DWL: MOV #MSG3-1,R2 ;Double Width Line MOVB #'6,3(R2) JMP PRINT3 ; SWL: MOV #MSG3-1,R2 ;Single Width Line MOVB #'5,3(R2) JMP PRINT3 ; PRINT3: .PRINT #MSG3 RTS PC MSG3: .ASCII <33>/#8/<200> .EVEN ; ;*********************************************************************** ; SGS: MOV #MSG3A-1,R2 ;Select Graphics Set MOVB #'0,3(R2) JMP PRIN3A ; DGS: MOV #MSG3A-1,R2 ;Deselect Graphics Set MOVB #'B,3(R2) JMP PRIN3A ; PRIN3A: .PRINT #MSG3A RTS PC MSG3A: .ASCII <33>/(0/<200> .EVEN ; ;*********************************************************************** ; CLRALL: MOV #MSG4-1,R2 ;CLeaR ALL of the screen MOVB #'2,3(R2) JMP ED ; CLRTOP: MOV #MSG4-1,R2 ;CLeaR the TOP of the screen MOVB #'1,3(R2) JMP ED ; CLRBOT: MOV #MSG4-1,R2 ;CLeaR the BOTtom of the screen MOVB #'0,3(R2) JMP ED ; ED: MOVB #'J,4(R2) ;[Erase the Display] JMP PRINT4 ;not Fortran callable ; LL: MOV #MSG4-1,R2 ;Light Led (on keyboard) MOVB #'q,4(R2) MOV (R5)+,R4 ;Move no. of args. to R4 BIC #177400,R4 ;Clear m.s. byte of R4 JSR PC,GETARG MOVB R1,3(R2) JMP PRINT4 ; CLRLIN: MOV #MSG4-1,R2 ;CLeaR LINe MOVB #'2,3(R2) JMP EL ; CLRBEG: MOV #MSG4-1,R2 ;CleaR BEGinning of line MOVB #'1,3(R2) JMP EL ; CLREND: MOV #MSG4-1,R2 ;CLeaR END of the line MOVB #'0,3(R2) JMP EL ; EL: MOVB #'K,4(R2) ;[Erase Line] JMP PRINT4 ;not Fortran callable ; NEGVID: MOV #MSG4-1,R2 ;NEGative VIDeo for next characters MOVB #'7,3(R2) JMP SGR ; POSVID: MOV #MSG4-1,R2 ;POSitive VIDeo for next characters MOVB #'0,3(R2) JMP SGR ; SGR: MOVB #'m,4(R2) ;[Select Graphics Rendition] JMP PRINT4 ;not Fortran callable ; PRINT4: .PRINT #MSG4 RTS PC MSG4: .ASCII <33>/[2J/<200> .EVEN ; ;********************************************************************** ; SM: MOV #MSG5-1,R2 ;Set Mode MOVB #'h,5(R2) JMP M ; RM: MOV #MSG5-1,R2 ;Reset Mode MOVB #'l,5(R2) JMP M ; M: MOVB #'?,3(R2) ;[Mode] - not Fortran callable MOV (R5)+,R4 ;Move no. of args. to R4 BIC #177400,R4 ;Clear m.s. byte of R4 JSR PC,GETARG MOVB R1,4(R2) JMP PRINT5 ; CUU: MOV #MSG5-1,R2 ;CUrsor Up MOVB #'A,5(R2) JMP CU ; CUD: MOV #MSG5-1,R2 ;CUrsor Down MOVB #'B,5(R2) JMP CU ; CUF: MOV #MSG5-1,R2 ;CUrsor Forward MOVB #'C,5(R2) JMP CU ; CUB: MOV #MSG5-1,R2 ;CUrsor Backward MOVB #'D,5(R2) JMP CU ; CU: MOV (R5)+,R4 ;Move no. of args. to R4 BIC #177400,R4 ;Clear m.s. byte of R4 JSR PC,GETARG MOVB R0,3(R2) MOVB R1,4(R2) JMP PRINT5 ; PRINT5: .PRINT #MSG5 RTS PC MSG5: .ASCII <33>/[?3l/<200> .EVEN ; ;*********************************************************************** ; CUP: MOV #MSG8-1,R2 ;CUrsor Position (relative to origin) MOVB #'H,8.(R2) JMP PRINT8 ; STBM: MOV #MSG8-1,R2 ;Set Top and Bottom Margins MOVB #'r,8.(R2) ;i.e. the scrolling region JMP PRINT8 ; PRINT8: MOV (R5)+,R4 ;Move no. of args. to R4 BIC #177400,R4 ;Clear m.s. byte of R4 JSR PC,GETARG MOVB R0,3(R2) MOVB R1,4(R2) JSR PC,GETARG MOVB R0,6(R2) MOVB R1,7(R2) .PRINT #MSG8 RTS PC MSG8: .ASCII <33>/[24;80H/<200> .EVEN ; ;********************************************************************** ; ; This subroutine takes the next argument and converts it to two ASCII ; characters, which are left in R0 (most significant) and R1 (least sig.). ; GETARG: MOV #'0,R0 ; Initialise R0 to '0' MOV #'1,R1 ; Initialise R1 to '1' TST R4 ; Test number of arguments BGT 1$ ; Branch if R4>0 RTS PC ; Here if no arguments left ; 1$: DEC R4 ; Decrement no. of args left MOV (R5)+,R3 ; Address of next arg -> R3 CMP R3,#-1 BNE 2$ ; Branch if arg. is not defaulted RTS PC ; Def.arg. -> R0='0', R1='1' ; 2$: MOV @R3,R1 ; Value of next arg. -> R1 CMP R1,#1 BGE 3$ ; Branch if arg>=1 MOV #'1,R1 RTS PC ; Arg<1 => R0='0', R1='1' ; 3$: CMP R1,#80. BLE 4$ ; Branch if arg<=80 MOV #'8,R0 MOV #'0,R1 RTS PC ; If arg>80 R1='8', R0='0' ; 4$: CLR R0 DIV #12,R0 ; Divide by 10. ADD #60,R0 ; Convert quotient to ASCII ADD #60,R1 ; Convert remainder to ASCII RTS PC ; ;********************************************************************** ; .END