1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-04 07:43:02 +00:00
Files
PDP-10.its/src/kcc/getsym.8
2017-02-15 19:27:00 +01:00

124 lines
2.0 KiB
Groff
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; -*- Midas -*-
title GETSYM - Extract ITS system symbol definitions
a=:1
b=:2
c=:3
d=:4
e=:5
t=:6
tt=:7
p=:17
chdsko=:16
call=:pushj p,
return=:popj p,
save==:push p,
rest==:pop p,
flose=:.lose %lsfil
slose=:.lose %lssys
pause=:.break 16,100000
quit=:.logout 1,
define syscall name,args
.call [setz ? .1stwd sixbit /name/ ? args(400000)]
termin
.insrt dsk:syseng;format >
outstr: syscall siot,[movei chdsko ? a ? b]
slose
return
define format &string&,args
call [
call $format
.zzz.==-1
irp arg,,[args]
save arg
.zzz.==.irpcnt
termin
hrroi a,[ascii string]
movei b,.length string
movni c,.zzz.+1
jrst format"format]
termin
$forma: save a
save b
save c
call @-3(p)
rest c
rest b
rest a
rest (p)
return
.vector pdl(lpdl==:100.)
usrvar: sixbit /OPTION/ ? tlo %opint\%opopc
sixbit /MASK/ ? move [%pipdl]
sixbit /XUNAME/ ? movem xuname
lusrvar==:.-usrvar
.scalar xuname,itsnam,itsvrs
go: move p,[-lpdl,,pdl-1]
move tt,[-lusrvar,,usrvar]
syscall usrvar,[movei %jself ? tt]
slose
syscall sstatu,[repeat 5,[ movem tt ? ] movem itsnam ? movem itsvrs]
slose
.vector syms(lsyms==:4000)
move t,[-lsyms,,syms]
move tt,[sixbit /CALLS/]
.getsys t,
.lose ; Just assemble with a larger LSYMS...
hrloi a,-1-syms(t)
eqvi a,syms ; A: aobjn to symbols
syscall open,[movsi .uao ? movei chdsko ? [sixbit /DSK/]
[sixbit /ITSSYM/] ? move itsvrs]
flose
.rdatim t,
format "; System symbols for ~S ITS ~S (dumped by ~S ~S-~S).~@
UNIVERSAL ITSSYM~@
ASUPPRESS~@
",[itsnam,itsvrs,xuname,t,tt]
loop: skipge 0(a)
jrst hkiled
move t,1(a)
tlne t,777000
jrst opdfed
format "~U=<~:H>~%",[0(a),1(a)]
jrst next
opdfed: format "OPDEF ~U [~:H]~%",[0(a),1(a)]
jrst next
hkiled: format "~U==<~:H>~%",[0(a),1(a)]
next: aobjn a,.+2
.lose ; Can't happen
aobjn a,loop
format "END~%"
quit
tsint:
loc 42
-ltsint,,tsint
loc tsint
400000,,p
ltsint==:.-tsint
cnstnts:
constants
variables
patch::
pat: block 100.
epatch: -1 ; Make memory exist, end of patch area
end go