mirror of
https://github.com/PDP-10/its.git
synced 2026-01-26 04:02:06 +00:00
GOTO - go to specified terminal line.
This commit is contained in:
95
src/kmp/goto.12
Normal file
95
src/kmp/goto.12
Normal file
@@ -0,0 +1,95 @@
|
||||
title LINE -- jump to screen line given by JCL
|
||||
|
||||
a=:1
|
||||
b=:2
|
||||
ttyo=:4
|
||||
ch=:6
|
||||
vpos=:10
|
||||
jclflg=:11
|
||||
|
||||
jclbuf: block 20 ; Give us 16. x 5 = 80. chars of JCL space
|
||||
-1 ; Tell DDT this is end of buffer
|
||||
|
||||
define type &string
|
||||
movei a,<.length string>
|
||||
move b,[440700,,[ascii string]]
|
||||
syscal SIOT,[%climm,,ttyo ? b ? a]
|
||||
.lose %lsfil
|
||||
termin
|
||||
|
||||
define syscal op,args
|
||||
.call [setz ? sixbit /op/ ? args ((setz))]
|
||||
termin
|
||||
|
||||
line: setzm vpos ; Init vpos to 0
|
||||
setzm jclflg ; Make sure loser uses jcl
|
||||
.break 12,[..RJCL,,JCLBUF] ; Read JCL
|
||||
move a,[440700,,JCLBUF] ; Init JCLBUF byte-pointer in a
|
||||
|
||||
loop: ildb ch,a ; Load char from JCLBUF into ch
|
||||
|
||||
caie ch,^M ; If char is a Carriage return...
|
||||
cain ch,^C ; or if char is a Control-C
|
||||
jrst print ; then done with loop
|
||||
|
||||
caie ch,^@ ; (Also...) If char is a Null
|
||||
cain ch,^_ ; or if char is a Control-_
|
||||
jrst print ; then done with loop
|
||||
|
||||
cail ch,"0 ; If less than 0
|
||||
caile ch,"9 ; or greater than 9
|
||||
jrst loop ; then retry
|
||||
|
||||
setom jclflg ; Say he used jcl
|
||||
imuli vpos,10. ; Move it over a bit
|
||||
addi vpos,-60(ch) ; Add into vpos the new char
|
||||
|
||||
jrst loop ; Loop
|
||||
|
||||
print: syscal OPEN,[ %clbit,,.uao\%tjdis ? %climm,,ttyo ;open TTY for output
|
||||
[sixbit /TTY/]]
|
||||
.lose %lsfil
|
||||
jumpe jclflg,jclwrn
|
||||
movei a,^P
|
||||
.iot ttyo,a
|
||||
movei a,"V
|
||||
.iot ttyo,a
|
||||
movei a,10(vpos)
|
||||
.iot ttyo,a
|
||||
movei a,^P
|
||||
.iot ttyo,a
|
||||
movei a,"H
|
||||
.iot ttyo,a
|
||||
movei a,0
|
||||
.iot ttyo,a
|
||||
movei a,^P
|
||||
.iot ttyo,a
|
||||
movei a,"L
|
||||
.iot ttyo,a
|
||||
.value [ asciz \:KILL \ ]
|
||||
|
||||
die: .logout 1,
|
||||
|
||||
jclwrn: movei a,^P
|
||||
.iot ttyo,a
|
||||
movei a,"H
|
||||
.iot ttyo,a
|
||||
movei a,0
|
||||
.iot ttyo,a
|
||||
movei a,^P
|
||||
.iot ttyo,a
|
||||
movei a,"L
|
||||
.iot ttyo,a
|
||||
.value [ asciz \
|
||||
.jname/ : Usage is :6type
|
||||
: <screenline><Control-C> :KILL KILL
|
||||
:jobp
|
||||
=:if e q
|
||||
(.jname/ :6type
|
||||
45200,,= :6type
|
||||
)
|
||||
:v \ ]
|
||||
jrst die
|
||||
|
||||
end line
|
||||
|
||||
Reference in New Issue
Block a user