;*; Updated on 22-May-91 at 12:10 PM by John Paiement; edit time: 0:01:15
; [100] - Created
; [101] - Added rubout to entry processing
; [102] - Modified screen draw module to TCRT codes to prevent awkward displays
VMAJOR=1.
VMINOR=0.
VEDIT=102.
.OFINI ; Define buffers
.OFDEF BUFFER,32. ; Input buffer
.OFDEF BUF2,16 ; Output buffer
.OFDEF BASE,1 ; Current base
.OFDEF FUNC,1 ; Current function
.OFDEF NOINP,1 ; Process of input flag
.OFDEF XITFLG,1 ; Program exit flag
.OFDEF INVAL,6 ; Input value
.OFDEF ACCUM,6 ; Current accumulated value
.OFDEF MEMVAL,6 ; Current memory contents
.OFDEF DISVAL,6 ; Value to be displayed
.OFDEF BYPASS,1 ; Bypass buffer manipulation
.OFDEF RADIN,4 ; Buffer for rad conversion
.OFDEF NFLAG,1 ; Flag to indicate negative value
.OFSIZ IMPSIZ ; Allocate impure area
; Base constants
DECN=0.
HEXN=1.
OCTN=2.
RADN=3.
BINN=4.
PPNN=5.
DEFINE DRWBOX AA,BB,CC
;
; draw a box at AA,BB of CC height/width codes from table B-5
;
MOVB #AA,D1 ; Position cursor to top left
LSLW D1,#8. ; Hand corner of of box
MOVB #BB,D1
TCRT
MOV #65372.,D1 ; Box draw call
TCRT
TYPE <CC> ; Height & width codes
EVEN
ENDM
DEFINE HORZLN AA,BB,CC
;
; Draw a graphic line at AA,BB of CC columns ( line_len - 1)
;
PRTTAB AA,BB
PRTTAB -1,23. ; Set line draw mode
MOV #CC,D1
PRTTAB -1,44. ; Left side connector
00$$:
PRTTAB -1,46. ; Horizontal line character
DEC D1
BNE 00$$
PRTTAB -1,43. ; Right side connector
PRTTAB -1,24. ; End line draw
ENDM
DEFINE GRFCHR AA,BB,CC
;
; Draw graphics character CC at AA,BB
;
PRTTAB AA,BB
PRTTAB -1,23. ; Line draw mode
PRTTAB -1,CC
PRTTAB -1,24. ; End line draw
ENDM
DEFINE SCRON
;
; Turn on screen display
;
MOV #65317.,D1 ; Screen on code
TCRT
ENDM
DEFINE PRTTAB AA,BB
;
; Emulate the print tab(x,x) function
;
PUSH D1
MOVB #AA,D1 ; First param in MSB
LSLW D1,#8.
MOVB #BB,D1 ; Second param in LSB
TCRT
POP D1
ENDM
DEFINE WINROW AA
;
; Position cursor at row AA, col (D2)
;
PUSH D1
MOVB #AA,D1 ; First param in MSB
LSLW D1,#8.
MOVB D2,D1 ; Second param in LSB
TCRT
POP D1
ENDM
DEFINE ROWCOL
;
; Emulate the print tab(x,x) function where row is already set at 5
; and offset by BASE(A5) * to by A2. Column is passed in D2
;
MOVB #5,D1
ADDB BASE(A5),D1
LSLW D1,#8.
MOVB D2,D1
TCRT
ENDM
DEFINE ONEKEY
;
; Make KBD call only accept 1 key ( from Assembler Programming by D. Heyliger )
;
JOBIDX A6
MOV JOBTRM(A6),A6
ORW #T$IMI,@A6
ENDM
DEFINE ECHO
;
; Enable terminal echo of input ( from Assembler Programming by D. Heyliger )
;
JOBIDX A6
MOV JOBTRM(A6),A6
MOVW #T$ECS,D1
COMW D1
ANDW D1,@A6
ENDM
DEFINE SETHEX
;
; Set JOBTYP for hex output
;
JOBIDX A6
MOVW JOBTYP(A6),D1
ORW #J.HEX,D1
MOVW D1,JOBTYP(A6)
ENDM