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
/
wrtv10.mac
< prev
next >
Wrap
Text File
|
1990-04-02
|
2KB
|
91 lines
.ENABL LC
.TITLE WRITE
.IDENT /MTREK/
;
; *** Digital Equiptment VT-100 ***
;
; 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
WRITE: MOV @2(R5),R1 ; GET LINE POSITION
MOV #LINE,R0 ; LOC OF BUFFER
MOV #11012,R2 ; UNSIGNED BASE 10 TWO CHARS WIDE
CALL $CBTA ; GO DO IT
MOV @4(R5),R1 ; AND COLUMN POSITION
MOV #COL,R0 ; LOC OF COL BUFFER
MOV #11012,R2 ; UNSIGNED BASE 10 TWO CHARS WIDE
CALL $CBTA ; GO DO IT
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: .ASCII <33>/[H/<33>/[J/ ; ESCAPE SEQUENCE TO CLEAR SCREEN
CLRNUM=.-CLRSEQ
WRTSEQ: .BYTE 33,'[ ; ESCAPE SEQUENCE FOR CURSOR POSITION
LINE: .BLKB 2 ; LINE POSITION
.BYTE '; ;
COL: .BLKB 2 ; COLUMN POSITION
.BYTE 'H ;
WRTNUM=.-WRTSEQ
.EVEN
.END