1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-04 23:54:37 +00:00

GETSYM and 20XCSV - KCC support programs.

This commit is contained in:
Lars Brinkhoff
2017-01-27 11:50:35 +01:00
parent 8218e0368a
commit 77ca595bd8
5 changed files with 205 additions and 3 deletions

73
src/kcc/20xcsv.1 Executable file
View File

@@ -0,0 +1,73 @@
TITLE 20XCSV
;Reads a 20X CSAVE file and writes an ITS bin file.
A=1
B=2
C=3
D=4
E=5
T=6
TT=7
P=17
DKIC=10
DKOC=11
PDL: -20,,.
BLOCK 21
JCL: BLOCK 10
GO: MOVE P,PDL
.BREAK 12,[5,,JCL]
MOVE A,[440700,,JCL]
MOVE D,[440600,,B]
MOVEI B,0
FNR: ILDB C,A
CAIG C,40
JRST FNR2
CAIGE C,140
SUBI C,40
TLNE D,770000
IDPB C,D
JRST FNR
FNR2: .CALL [ SETZ ? SIXBIT/OPEN/ ? [.BII,,DKIC] ? [SIXBIT/DSK/] ? B ? SETZ ['20XBIN] ]
.LOSE %LSFIL
.CALL [ SETZ ? SIXBIT/OPEN/ ? [.BIO,,DKOC] ? [SIXBIT/DSK/] ? B ? SETZ ['BIN,,] ]
.LOSE %LSFIL
HRROI T,[JRST 1] ;F A D?
.IOT DKOC,T
LP: HRROI T,TT
.IOT DKIC,T ;Get IOWD
JUMPL T,EOFERR
JUMPGE TT,SADR
ADDI TT,1 ;AOBJN pointer
MOVE B,TT
MOVE D,TT ;Accumulate checksum in D
HRROI T,TT
.IOT DKOC,T
LP1: HRROI T,TT
.IOT DKIC,T
JUMPL T,EOFERR
ROT D,1
ADD D,TT
HRROI T,TT
.IOT DKOC,T
AOBJN B,LP1
HRROI T,D
.IOT DKOC,T
JRST LP
EOFERR: .VALUE
SADR: HRROI T,TT ;Output start address twice, no symbols
.IOT DKOC,T
HRROI T,TT
.IOT DKOC,T
.CLOSE DKOC,
.LOGOUT 1,
END GO

123
src/kcc/getsym.8 Executable file
View File

@@ -0,0 +1,123 @@
; -*- 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