home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.lbl.gov
/
2014.05.ftp.ee.lbl.gov.tar
/
ftp.ee.lbl.gov
/
mtrek.shar.Z
/
mtrek.shar
/
wrtv52.mac
< prev
next >
Wrap
Text File
|
1990-04-02
|
2KB
|
88 lines
.ENABL LC
.TITLE WRITE
.IDENT /MTREK/
;
; *** Digital Equiptment VT-52 ***
;
; FORTRAN callable routine to postion the cursor on a crt
; terminal and write a string. There is also a routine to
; clear the screen.
;
; Calling sequence:
;
; CALL WRITE(LINE,ICOL,STRING[,ICNT])
;
; LINE Line to position cursor on
; ICOL Column to position cursor on
; STRING String of text to output
; ICNT Optional character count
;
; Calling sequence:
;
; CALL CLEAR
;
.GLOBL WRITE,CLEAR
LUN=1 ; LUN FOR QIOS
OFFSET=37 ; OFFSET FOR CURSOR ADDRESSING
WRITE: MOV @2(R5),R0 ; GET LINE POSITION
ADD #OFFSET,R0 ; ADD OFFSET
MOVB R0,LINE ; AND STORE IN BUFFER
MOV @4(R5),R0 ; NOW COLUMN POSITION
ADD #OFFSET,R0 ; ADD OFFSET
MOVB R0,COL ; AND PUT IN BUFFER
MOV 6(R5),BUFADR ; MOVE STRING ADDRESS TO LIST
CMPB #4,(R5) ; CHARACTER COUNT INPUT?
BEQ 10$ ; BRANCH IF COUNT INPUT
MOV #1,BUFARG ; ONLY ONE ARGUMENT TO FILL
BR 20$ ; GO DO IT
10$: MOV #2,BUFARG ; TWO ARGUMENTS TO FILL
MOV 10(R5),BUFCNT ; COPY ADDRESS OF COUNT TO LIST
20$: MOV #WRTARG,R5 ; SET UP ARGUMENTS FOR CURSOR
CALL FILL ; AND SEND CURSOR
MOV #BUFARG,R5 ; SET UP ARGUMENTS FOR STRING
TSTB @2(R5) ; CHECK FOR ZERO LENGTH STRING
BEQ 30$ ; BAIL OUT IF ZERO LENGTH
CALL FILL ; AND SEND STRING
30$: RETURN ; AND RETURN
;
; Here is the entry for clear screen
;
CLEAR: MOV #CLRARG,R5 ; SET UP THE ARGUMENTS FOR FILL
CALL FILL ; AND CALL FILL
RETURN ; AND RETURN
;
; Here are the argument lists
;
WRTARG: .WORD 2 ; NUMBER OF ARGUMENTS TO FILL
.WORD WRTSEQ ; ADDRESS OF CURSOR SEQUENCE
.WORD 100$ ; CHAR COUNT
.WORD 0
100$: .WORD WRTNUM
BUFARG: .WORD 0 ; NUMBER OF ARGUMENTS TO FILL
BUFADR: .WORD 0 ; ADDRESS OF STRING
BUFCNT: .WORD 0 ; CHAR COUNT
.WORD 0
CLRARG: .WORD 2 ; NUMBER OF ARGUMENTS TO FILL
.WORD CLRSEQ ; ADDRESS OF CLEAR SCREEN SEQUENCE
.WORD 200$ ; CHAR COUNT
.WORD 0
200$: .WORD CLRNUM
;
; Here are the escape sequences
;
.NLIST BIN
CLRSEQ: .BYTE 33,110,33,'J ; ESCAPE SEQUENCE TO CLEAR SCREEN
CLRNUM=.-CLRSEQ
WRTSEQ: .BYTE 33,'Y ; ESCAPE SEQUENCE FOR CURSOR POSITION
LINE: .BYTE 0 ; LINE POSITION
COL: .BYTE 0 ; COLUMN POSITION
WRTNUM=.-WRTSEQ
.EVEN
.END