Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0135/06/vtmcur.mac
There are 2 other files named vtmcur.mac in the archive. Click here to see a list.
00100 COMMENT * vtmcur, SIMULA specification;
00200 OPTIONS(/E:QUICK,vtmcur);
00300 PROCEDURE vtmcur(param,horiz,vertic);
00400 NAME param; INTEGER param; INTEGER horiz,vertic;
00500 COMMENT moves the cursor to the screen position
00600 identified by horiz,vertic;
00700
00800
00900 !*;! MACRO-10 code !*;!
01000
01100 TITLE vtmcur
01200 ENTRY vtmcur ;! simula calling
01300 ENTRY mamcur ;! macro calling, with xbase,xlow,xwac1,xbh loaded
01400 ENTRY symcur ;! always move, even if you are there
01500 SUBTTL VIDED subroutine, Jacob Palme 1978
01600
01700 ;!*** Copyright 1978 by the Swedish Defence Research Institute. ***
01800
01900 sall
02000 search simmac,simmcr,simrpa
02100 search vtmvda
02200 macinit
02300
02400 COMMENT* REGISTER USAGE IN THIS PROCEDURE
02500 X0 Temporary use
02600 X1 Used by IONB via OUTCHR, other temporary use
02700 X2 ==XTAC when calling function procedures
02800 X3 ==XWAC1 = first parameter used to load XBASE,
02900 = reference to sysout used by IONB via OUTCHR
03000 X4 == ep temporary use as byte pointer elite 2500 dca
03100 X5 ==horiz
03200 X6 ==vertic
03300 X7 ==XBH = used by OUTCHR, buffer header pointer
03400 X10 free
03500 X11 free
03600 X12 ==I = loop variable
03700 = used for byte pointer to elitecursors
03800 X13 ==XTYP = terminal type number
03900 X14 ==XBASE = base of mvistax SIMULA data block
04000 X15 ==XCB current block pointer, used by RTS
04100 X16 ==XLOW points to static area in RTS, used by RTS
04200 X17 ==XPDP push down list pointer
04300 *;!
04400
04500 bup==OFFSET(ZBHBUP)
04600 cnt==OFFSET(ZBHCNT)
04700
04800 ;! OUTCHR assumes XWAC1 = file ref for Sysout, XBH pointer to
04900 ;! buffer header. XWAC1==AC3, XBH==AC7.
05000 ;! OUTCHR moves the character in AC0 to the SYSOUT output
05100 ;! file buffer. IF a parameter is given, the contents of
05200 ;! the word with the given offset from xbase is loaded into
05300 ;! AC0 first. xbase refers to the mvistax class block instance.
05400
05500 DEFINE outchr(c)<
05600 IFNB <c>,<L c(xbase)>
05700 SOSGE cnt(XBH)
05800 XEC IONB
05900 IDPB bup(XBH)
06000 >
06100
06200 ;! trueoutchr takes its parameter in X0
06300 DEFINE trueoutchr<
06400 XEC troutc
06500 >
06600
06700 DEFINE elicur(n)<
06800 IF2,<IFNDEF VT$BPT,<EXTERN VT$BPT>>
06900 LI X0,(n)
07000 IDIVI X0,5
07100 HLL X0,VT$BPT+1(X1)
07200 ADDI X0,elitecursors
07300 LDB X0,X0>
07400
07500 ;! Local definitions ;!
07600
07700 horiz==XWAC1+2 ;! AC5
07800 vertic==horiz+1 ;! AC6
07900
08000 xbase==X14 ;! base of mvistax class instance block
08100 xtyp== X13 ;! terminal type number
08200 bp==X4 ;! temporary byte pointer for elite 2500
08300 i==X12 ;! index in no of character loops
08400
08500 vtmcur: PROC ;! entry point when called from SIMULA
08600 ;! Set up environment variables
08700 LF xbase,ZFLZBI(,XWAC1) ;! Base of MVISTAX block (vtmvda offsets)
08800 LOWADR ;! XLOW points to static area
08900 L XWAC1,YSYSOUT(XLOW) ;! XWAC1==AC3:- Sysout for OUTCHR!
09000 LF XBH,ZFIOBH(XWAC1) ;! XBH==AC7:- buffer header
09100 SUBI XBH,1 ;! Compute buffer header reference
09200 L xtyp,trmtyp(xbase) ;! terminaltype in register xtyp
09300
09400 mamcur: ;! entry point when called from MACRO
09500 ;! IF horiz = q_horizontalpos AND vertic = q_verticalpos
09600 ;! THEN GOTO moved
09700 IF
09800 CAMN horiz,qhoriz(xbase)
09900 CAME vertic,qvertic(xbase)
10000 GOTO FALSE
10100 THEN
10200 GOTO moved
10300 FI
10400
10500 symcur: ;! entry point where always moving
10600 SKIPN qdisplayoutput(xbase) ;! IF NOT q_display_output THEN
10700 GOTO moved ;! no terminal output
10800 IF ;! direct cursor addressing
10900 SKIPN direct(xbase)
11000 GOTO FALSE
11100 THEN
11200 IF ;! terminaltype = minitec
11300 CAME xtyp,minitec(xbase)
11400 GOTO FALSE
11500 THEN
11600 LI QESC
11700 outchr
11800 outchr(addressscreen)
11900 LI 177
12000 SUB horiz
12100 trueoutchar ;! trueoutchr(127-horiz)
12200 LI 177
12300 SUB vertic
12400 trueoutchar ;! trueoutchr(127-vertic)
12500 ELSE
12600 IF ;! elite <= terminaltype <= kthelite
12700 CAML xtyp,elite(xbase)
12800 CAMLE xtyp,kthelite(xbase)
12900 GOTO FALSE
13000 THEN
13100 outchr(addressscreen)
13200 ;! true_outchr(fetchar(elitecursors,horiz+1))
13300 ;! elitecursors is local literal in this macro program
13400 elicur(horiz)
13500 trueoutchar
13600 ;! true_outchr(fetchar(elitecursors,vertic+1))
13700 ;! elitecursors is local literal in this macro program
13800 elicur(vertic)
13900 trueoutchar
14000 ELSE
14100 IF ;! terminaltype = newelite OR elite1521 OR
14200 ;! newkthelite OR i200 OR elite3025
14300 CAME xtyp,newelite(xbase)
14400 CAMN xtyp,elite1521(xbase)
14500 GOTO TRUE
14600 CAMN xtyp,newkthelite(xbase)
14700 GOTO TRUE
14800 CAMN xtyp,elite3025(xbase)
14900 GOTO TRUE
15000 CAME xtyp,i200(xbase)
15100 GOTO FALSE
15200 THEN
15210 IF ;! addaltmode
15219 SKIPN addaltmode(xbase)
15228 GOTO FALSE
15237 THEN
15246 LI qesc
15255 outchr
15264 FI
15300 outchr(addressscreen)
15400 LI 40(horiz) ;! true_outchr(horiz+40)
15500 trueoutchr
15600 LI 40(vertic) ;! true_outchr(horiz+40)
15700 trueoutchr
15800 ELSE
15900 IF ;! terminaltype = volker414H THEN
16000 CAME xtyp,vc414h(xbase)
16100 GOTO FALSE
16200 THEN
16300 LI qesc ;! outchr(sysout,altmode,1)
16400 outchr
16500
16600 ;! forceout(sysout)
16700 ofile==xwac1
16800 LF XBH,ZFIOBH(ofile)
16900 SUBI XBH,1
17000 LF X1,ZBHZBU(XBH)
17100 HRRZ X2,OFFSET(ZBHBUP)(XBH)
17200 IF ;! Nothing written
17300 CAIG X2,2(X1)
17400 SKIPE 2(X1)
17500 GOTO FALSE
17600 THEN
17700 GOTO forced ;! IONB returns here!
17800 FI
17900 XEC IONB
18000 forced:
18100
18200 ;! outche(ioindex,address_screen)
18300 LI X0,"Q"-100 ;! CONTROL-Q
18400 TTCALL 15,0 ;! image mode output
18500
18600 ;! true_outchr(char(if horiz < 32 then horiz+96 else horiz))
18700 LI 140(horiz) ;! X0:= horiz+96
18800 CAIL horiz,40
18900 LI 0(horiz) ;! X0:= horiz
19000 trueoutchr
19100 ;! true_outchr(vertic+64)
19200 LI 100(vertic) ;! X0:= vertic+64
19300 trueoutchr
19400 ELSE ;! All other terminal modes at present
19500 IF
19600 SKIPN addaltmode(xbase) ;! If addaltmode
19700 GOTO FALSE
19800 THEN
19900 LI qesc
20000 outchr
20100 FI
20200 outchr(addressscreen)
20300 LI 40(vertic) ;! true_outchr(vertic+40)
20400 trueoutchr
20500 LI 40(horiz) ;! true_outchr(horiz+40)
20600 trueoutchr
20700 FI FI FI FI
20800 GOTO moved
20900 FI