--- cam.doc --- 5
Written by E.G.Bajmo'czy, 1979.
MTA, Budapest XIII. V.Hugo u. 18-22. Hungary.
The dissembler CAM reads a task file and translates it to a macro source file.
It solicits for the boundaries of an overlay given by ZAP /RO/LI.
Zero line length means no concatenation.
--- cam.cmd;32 --- 42
.ENABLE LOWERCASE
.ENABLE SUBSTITUTION
.IFNINS ...MAC ins $bigmac
.IFNINS ...F4P .SETT F4P
.IFDF F4P asn dk1:=lb:
.IFDF F4P ins dk1:$f4p
.IFDF F4P asn =lb:
.IFNINS ...FOR ins dk1:$for
.1:.ASK D data
.IFF D .GOTO 1
.ASK E edi
.IFT E edi d2.ftn
for data,ti:=d2
.1:.ASK O oct
.IFF O .GOTO 1
.ASK E edi
.IFT E edi oct.ftn
f4p oct,ti:=oct
.1:.ASK N next
.IFF N .GOTO 1
.ASK E edi
.IFT E edi next.ftn
f4p next,ti:=next
.1:.ASK A add
.IFF A .GOTO 1
.ASK E edi
.IFT E edi add.mac
mac add=add
.1:.ASK C conv
.IFF C .GOTO 1
.ASK E edi
.IFT E edi conv.ftn
f4p conv,ti:=conv
.1:.ASK L line
.IFF L .GOTO 1
.ASK E edi
.IFT E edi lin2.ftn
f4p line,ti:=lin2
.1:pip *.obj/pu,*.tsk
tkb @cam.bld
.IFINS CAM rem cam
ins cam
--- cam.bld;6 --- 6
cam/cp=line,conv,oct,next,data,add
dk1:[1,1]f4pots.olb/lb
/
ASG=TI:1
task=...cam
//

--- d2.ftn;37 --- 137
	BLOCK DATA
C 11/34 instruction set
	IMPLICIT INTEGER (A-Z)
	COMMON /X/ JATT,TT0,TT,KI,NK,EV,PC,PC00AC,pcmmov,qrec,hetven
	COMMON /CMDTBL/ KH,T
	INTEGER TT(512),KI(100),KH(19),T(10,124)
	LOGICAL*1 KB(200)
	EQUIVALENCE (KI(1),KB(1))
	DATA KH/"0,"1,"3,"7,"17,"37,"77,"177,"377,"777,"1777,"3777,
     +"7777,"17777,"37777,"77777,"177777,"177777,"177777/
	DATA T/
     +"0,"0,'||','||','0 ','  ',0,0,0,0
     +,"1,"1,'wa','it','  ','  ',0,0,0,0
     +,"2,"2,'rt','i;','?2','  ',0,0,0,0
     +,"3,"3,'bp','t;','?3','  ',0,0,0,0
     +,"4,"4,'io','t;','?4','  ',0,0,0,0
     +,"5,"5,'re','se','t;','?5',0,0,0,0
     +,"6,"6,'rt','t;','?6','  ',0,0,0,0
     +,"7,"77,'? ','  ','  ','  ',0,0,0,0
     +,"136,"136,'RE','Tu','rn','  ',0,0,0,0
     +,"100,"177,'JM','P ','  ','  ',0,0,0,6
     +,"207,"207,'RE','TU','RN','  ',0,0,0,0
     +,"200,"207,'RT','S ','  ','  ',0,-3,0,0
     +,"210,"227,'? ','  ','  ','  ',0,0,0,0
     +,"230,"237,'?s','pl','  ','  ',0,0,0,0
     +,"240,"240,'no','p ','  ','  ',0,0,0,0
     +,"240,"257,'cl','..','. ','  ',0,0,-5,4
     +,"260,"277,'se','..','. ','  ',0,0,-5,4
     +,"300,"377,'sw','ab','  ','  ',0,-6,0,0
     +,"400,"777,'BR','  ','  ','  ',0,0,-2,8
     +,"1000,"1377,'BN','E ','  ','  ',0,0,-2,8
     +,"1400,"1777,'BE','Q ','  ','  ',0,0,-2,8
     +,"2000,"2377,'BG','E ','  ','  ',0,0,-2,8
     +,"2400,"2777,'BL','T ','  ','  ',0,0,-2,8
     +,"3000,"3377,'BG','T ','  ','  ',0,0,-2,8
     +,"3400,"3777,'BL','E ','  ','  ',0,0,-2,8
     +,"4700,"4777,'CA','LL','  ','  ',0,0,0,6
     +,"4000,"4777,'JS','R ','  ','  ',6,-9,0,6
     +,"5000,"5077,'cl','r ','  ','  ',0,0,0,-6
     +,"5100,"5177,'co','m ','  ','  ',0,0,0,-6
     +,"5200,"5277,'in','c ','  ','  ',0,0,0,-6
     +,"5300,"5377,'de','c ','  ','  ',0,0,0,-6
     +,"5400,"5477,'ne','g ','  ','  ',0,0,0,-6
     +,"5500,"5577,'ad','c ','  ','  ',0,0,0,-6
     +,"5600,"5677,'sb','c ','  ','  ',0,0,0,-6
     +,"5700,"5777,'ts','t ','  ','  ',0,0,0,6
     +,"6000,"6077,'ro','r ','  ','  ',0,0,0,-6
     +,"6100,"6177,'ro','l ','  ','  ',0,0,0,-6
     +,"6200,"6277,'as','r ','  ','  ',0,0,0,-6
     +,"6300,"6377,'as','l ','  ','  ',0,0,0,-6
     +,"6400,"6477,'ma','rk','  ','  ',0,0,-5,6
     +,"6500,"6577,'mf','pi','  ','  ',0,0,0,+6
     +,"6600,"6677,'mt','pi','  ','  ',0,0,0,-6
     +,"6700,"6777,'sx','t ','  ','  ',0,0,0,-6
     +,"7000,"7777,'? ','  ','  ','  ',0,0,0,0
     +,"10000,"17777,'mo','v ','  ','  ',6,12,0,-6
     +,"20000,"27777,'cm','p ','  ','  ',6,12,0,6
     +,"30000,"37777,'bi','t ','  ','  ',6,12,0,6
     +,"40000,"47777,'bi','c ','  ','  ',6,12,0,-6
     +,"50000,"57777,'bi','s ','  ','  ',6,12,0,-6
     +,"60000,"67777,'ad','d ','  ','  ',6,12,0,-6
     +,"70000,"70777,'mu','l ','  ','  ',0,6,6,-9
     +,"71000,"71777,'di','v ','  ','  ',0,6,6,-9
     +,"72000,"72777,'as','h ','  ','  ',0,6,6,-9
     +,"73000,"73777,'as','hc','  ','  ',0,6,6,-9
     +,"74000,"74777,'xo','r ','  ','  ',6,9,0,-6
     +,"75000,"75007,'?f','ad','d ','  ',0,0,0,-3
     +,"75010,"75017,'?f','su','b ','  ',0,0,0,-3
     +,"75020,"75027,'?f','mu','l ','  ',0,0,0,-3
     +,"75030,"75037,'?f','di','v ','  ',0,0,0,-3
     +,"75040,"76777,'? ','  ','  ','  ',0,0,0,0
     +,"77000,"77777,'so','b ','  ','  ',6,-9,-4,6
     +,"100000,"100377,'BP','L ','  ','  ',0,0,-2,8
     +,"100400,"100777,'BM','I ','  ','  ',0,0,-2,8
     +,"101000,"101377,'BH','I ','  ','  ',0,0,-2,8
     +,"101400,"101777,'BL','OS','  ','  ',0,0,-2,8
     +,"102000,"102377,'BV','C ','  ','  ',0,0,-2,8
     +,"102400,"102777,'BV','S ','  ','  ',0,0,-2,8
     +,"103000,"103377,'BC','C ','  ','  ',0,0,-2,8
     +,"103400,"103777,'BC','S ','  ','  ',0,0,-2,8
     +,"104000,"104377,'EM','T ','  ','  ',0,0,-5,8
     +,"104400,"104777,'TR','AP','  ','  ',0,0,-5,8
     +,"105000,"105077,'cl','rb','  ','  ',0,0,0,-6
     +,"105100,"105177,'co','mb','  ','  ',0,0,0,-6
     +,"105200,"105277,'in','cb','  ','  ',0,0,0,-6
     +,"105300,"105377,'de','cb','  ','  ',0,0,0,-6
     +,"105400,"105477,'ne','gb','  ','  ',0,0,0,-6
     +,"105500,"105577,'ad','cb','  ','  ',0,0,0,-6
     +,"105600,"105677,'sb','cb','  ','  ',0,0,0,-6
     +,"105700,"105777,'ts','tb','  ','  ',0,0,0,6
     +,"106000,"106077,'ro','rb','  ','  ',0,0,0,-6
     +,"106100,"106177,'ro','lb','  ','  ',0,0,0,-6
     +,"106200,"106277,'as','rb','  ','  ',0,0,0,-6
     +,"106300,"106377,'as','lb','  ','  ',0,0,0,-6
     +,"106400,"106477,'mt','PS','  ','  ',0,0,0,6
     +,"106500,"106577,'mf','pd','  ','  ',0,0,0,+6
     +,"106600,"106677,'mt','pd','  ','  ',0,0,0,-6
     +,"106700,"106777,'mf','PS','  ','  ',0,0,0,-6
     +,"107000,"107777,'? ','  ','  ','  ',0,0,0,0
     +,"110000,"117777,'mo','vb','  ','  ',6,12,0,-6
     +,"120000,"127777,'cm','pb','  ','  ',6,12,0,6
     +,"130000,"137777,'bi','tb','  ','  ',6,12,0,6
     +,"140000,"147777,'bi','cb','  ','  ',6,12,0,-6
     +,"150000,"157777,'bi','sb','  ','  ',6,12,0,-6
     +,"160000,"167777,'su','b ','  ','  ',6,12,0,-6
     +,"170000,"177777,'? ','  ','  ','  ',0,0,0,0
     +,"170000,"170000,'?c','fc','c ','  ',0,0,0,0
     +,"170001,"170001,'?s','et','f ','  ',0,0,0,0
     +,"170002,"170002,'?s','et','i ','  ',0,0,0,0
     +,"170003,"170010,'??','  ','  ','  ',0,0,0,0
     +,"170011,"170011,'?s','et','d ','  ',0,0,0,0
     +,"170012,"170012,'?s','et','f ','  ',0,0,0,0
     +,"170013,"170077,'??','  ','  ','  ',0,0,0,0
     +,"170100,"170177,'?l','df','ps','  ',0,6,0,0
     +,"170200,"170277,'?s','tf','ps','  ',0,6,0,0
     +,"170300,"170377,'?s','ts','t ','  ',0,6,0,0
     +,"170400,"170477,'?c','lr','df','  ',0,0,0,0
     +,"170500,"170577,'?t','st','df','  ',0,0,0,0
     +,"170600,"170677,'?a','bs','df','  ',0,0,0,0
     +,"170700,"170777,'?n','eg','df','  ',0,0,0,0
     +,"171000,"171377,'?m','ul','df','  ',0,0,0,0
     +,"171400,"171777,'?m','od','df','  ',0,0,0,0
     +,"172000,"172377,'?a','dd','df','  ',0,0,0,0
     +,"172400,"172777,'?l','dd','f ','  ',0,0,0,0
     +,"173000,"173377,'?s','ub','df','  ',0,0,0,0
     +,"173400,"173777,'?c','mp','df','  ',0,0,0,0
     +,"174000,"174377,'?s','td','f ','  ',0,0,0,0
     +,"174400,"174777,'?d','iv','df','  ',0,0,0,0
     +,"175000,"175377,'?s','te','xp','  ',0,0,0,0
     +,"175400,"175777,'?s','tc','df','il',0,0,0,0
     +,"176000,"176377,'?s','tc','df','fd',0,0,0,0
     +,"176400,"176777,'?l','de','xp','  ',0,0,0,0
     +,"177000,"177377,'?l','dc','il','df',0,0,0,0
     +,"177400,"177777,'?l','dc','df','fd',0,0,0,0
     +,"177777,"177777,'??','  ','  ','  ',0,0,0,0
     +/
	END

--- oct.ftn;23 --- 26
	SUBROUTINE OCT(TMP)
	IMPLICIT INTEGER (A-Z)
	COMMON /X/ JATT,TT0,TT,KI,NK,EV,PC,PC00AC,pcmmov,qrec,hetven
	COMMON /CMDTBL/ KH,T
	INTEGER TT(512),KI(100),KH(19),T(10,124)
	LOGICAL*1 KB(200)
	EQUIVALENCE (KI(1),KB(1))
	H=1
	temp=tmp
	if (temp.ge.0.or.temp.lt.-"777) goto 1
	nk=nk+1
	kb(nk)="55
	temp=-temp
1	DO 2 B=16,1,-3
	V=TEMP.AND.(KH(B).XOR.KH(B+3))
	IF (V.EQ.0) GOTO 3
	H=B
	IF (B.EQ.1) GOTO 3
	V=V/(KH(B).XOR.KH(B+1))
	IF (V.LT.0) V=-V !!!
3	IF (H.LT.B) GOTO 2
	NK=NK+1
	KB(NK)="60+V
2	CONTINUE
	RETURN
	END

--- next.ftn;57 --- 26
	LOGICAL FUNCTION NEXT
	IMPLICIT INTEGER (A-Z)
	COMMON /X/ JATT,TT0,TT,KI,NK,EV,PC,PC00AC,pcmmov,qrec,hetven
	COMMON /CMDTBL/ KH,T
	INTEGER TT(512),KI(100),KH(19),T(10,124)
	LOGICAL*1 KB(200)
	EQUIVALENCE (KI(1),KB(1))
	PC=PC+2
	NEXT=EV.NE.0
	IF (.NOT.NEXT) GOTO 2
	IF (JATT.GT.3) STOP 'EV'
	TT(JATT+1)=-1
2	j=jatt
	if ((jatt.and."377)*2.ge.qrec) jatt=(jatt.and."400)+"400
	JATT=(JATT.AND."777)+1
	if (j.ne.tt0) return
	tt0=jatt
	IF ((JATT.AND."377).NE.1) RETURN
	READ (3,1,END=17) Qrec, (TT(G), G=JATT,JATT+"377)
1	FORMAT(Q,16(16A2))
	GOTO 18
17	Qrec=-73
18	NEXT=Qrec.LE.4
	IF (NEXT) EV=EV+1
	RETURN
	END

--- add.mac;4 --- 5
ADDM::	ADD	#4,R5
	ADD	@-2(R5),@(R5)
	CLC
	RTS PC
	.END

--- conv.ftn;116 --- 139
	SUBROUTINE CMDDEC
	IMPLICIT INTEGER (A-Z)
	COMMON /X/ JATT,TT0,TT,KI,NK,EV,PC,PC00AC,pcmmov,qrec,hetven
	COMMON /CMDTBL/ KH,T
	INTEGER TT(512),KI(100),KH(19),T(10,124)
	LOGICAL*1 KB(200)
	EQUIVALENCE (KI(1),KB(1))
	LOGICAL*1 PM(2), TL(20,124)
	EQUIVALENCE (PL,PM(1)), (T(1),TL(1))
	E=0
	IF (NEXT()) RETURN
	U=TT(JATT)
	DO 27 A=1,124
27	IF (T(1,A).LE.U.AND.T(2,A).GE.U) GOTO 43
	STOP 'A>124'
43	CONTINUE
	if (tl(5,a).ne."77) goto 41
	call oct(u)
	nk=nk+1
	kb(nk)="73
41	continue
	NKN=NK+1
	DO 42 IB=5,12
	NK=NK+1
	KB(NK)=TL(IB,A)
	IF (KB(NK).EQ."40) NK=NK-1
	if (kb(nk).eq."174) kb(nk)="40
42	continue
	NK=NK+1
	KB(NK)="40
	if (hetven.eq.0) kb(nk)="11
	nke=nk+1
	K=5
34	k=k+2
	D=T(K,A)
	D1=T(K+1,A)
	IF (D.EQ.D1) GOTO 33
	C=U.AND.KH(MAX0(D1,-D1)+1)
	IF (D.GT.0) C=C/(KH(D+1)+1)
30	TEMP=C
	IF (D.LT.0) C="67-"40*D
	c76=c.and."76
	C67=C.AND."67
	c66=c.and."66
	C7=C.AND.7
	C8=C.AND."10
	if (c76.eq."26.and.d1.lt.0) e=e+1
	if (c.ge."60.or.c67.eq."27) goto 60
	if ((c67.eq.7.and.(c.ne.7.or.d1.lt.0))
     +.or.(c66.eq."46.and.(c.ne."46.or.d1.ge.0))) e=e+1
	if (c.le.7.and.(t(2,a).eq."177.or.
     +t(2,a).eq."4777.and.k.eq.9)) e=e+1
	if (k.eq.7.and.c.eq.6.and.d1.lt.0) e=e+1
	IF (C8.EQ.0) GOTO 51
	NK=NK+1
	KB(NK)="100
51	IF (C67.LT."40) GOTO 52
	NK=NK+1
	KB(NK)="55
52	IF (C67.LT."20) GOTO 53
	NK=NK+1
	KB(NK)="50
53	NK=NK+1
	KB(NK)="122
	IF (C7.EQ.6) KB(NK)="123
	IF (C7.EQ.7) KB(NK)="120
	NK=NK+1
	KB(NK)="60+C7
	IF (C7.EQ.6) KB(NK)="120
	IF (C7.EQ.7) KB(NK)="103
	IF (C67.LT."20) GOTO 55
	NK=NK+1
	KB(NK)="51
	IF (C67.GE."40) GOTO 55
	NK=NK+1
	KB(NK)="53
55	NK=NK+1
	KB(NK)="54
33	IF (K.lt.9) GOTO 34
	NK=NK-1
80	continue
	NK=NK+1
	KB(NK)="174
81	IF (E.EQ.0) RETURN
	DO 82 FH=NK,NKE,-1
82	KB(FH+1)=KB(FH)
	KB(NKE)="77
	NK=NK+1
	NKE=NKE+1
	E=E-1
	GOTO 81
60	CONTINUE
	IF (C.LT."100) GOTO 67
	IF (C.GE."300) GOTO 168
	TEMP=TEMP*2
	IF (C.GE."200) TEMP=-TEMP
	IF (TEMP.GE."400) TEMP=TEMP-"1000
	GOTO 68
67	IF (NEXT()) E=E+1
	TEMP=TT(JATT)
68	CONTINUE
	IF (C67.NE."27) GOTO 62
	if (c.ge."40) goto 65
	IF (C8.NE.0) nk=nk+1
	IF (C8.NE.0) KB(NK)="100
	NK=NK+1
	KB(NK)="43
	GOTO 65
62	IF (C8.EQ.0) GOTO 61
	NK=NK+1
	KB(NK)="100
61	IF (C7.EQ.7) GOTO 66
	call oct(temp)
	NK=NK+1
	KB(NK)="50
	NK=NK+1
	KB(NK)="122
	NK=NK+1
	KB(NK)="60+C7
	IF (C7.NE.6) GOTO 63
	KB(NK-1)="123
	KB(NK)="120
63	NK=NK+1
	KB(NK)="51
	GOTO 55
66	CALL ADDM(PC,TEMP)
65	CALL OCT(TEMP)
	GOTO 55
168	if (t(2,a).ge."400.or.t(2,a).lt.0) goto 68
	nks=nk
	if ((U.and.1).ne.0) kb(nk)="103
	nks=nks-1
	if ((U.and.2).ne.0) kb(nks)="126
	nks=nks-1
	if ((U.and.4).ne.0) kb(nks)="132
	nks=nks-1
	if ((U.and.8).ne.0) kb(nks)="116
	goto 80
	END

--- lin2.ftn;103 --- 74
	IMPLICIT INTEGER (A-Z)
	COMMON /X/ JATT,TT0,TT,KI,NK,EV,PC,PC00AC,pcmmov,qrec,hetven
	COMMON /CMDTBL/ KH,T
	INTEGER TT(512),KI(100),KH(19),T(10,124)
	LOGICAL*1 KB(200)
	EQUIVALENCE (KI(1),KB(1))
	logical*1 tnam(80)
	type 60
60	format (' CAM>'$)
	accept 61,tnl,tnam
61	format (q,80a1)
9	CALL FDBSET (3, 'READONLY', 'SHARE')
	CALL ASSIGN (3, tnam,tnl)
	TYPE 74
74	FORMAT (' LINE=72 OR 132?'$)
	ACCEPT 75, HETVEN
75	FORMAT (I3)
	JATT=0
	tt0=0
	EV=0
	NK=0
71	nk0=0
	nkk=0
	type 62
62	format (' rel lbn:'$)
	accept 73,lbn
	type 63
63	format (' min VA:'$)
	ACCEPT 73,PC00AC
73	FORMAT (O6)
	if ((pc00ac.and.1).ne.0) goto 71
	type 64
64	format (' max VA:'$)
	accept 73,pcmmov
	pc=0
	goto 81
80	if (next()) goto 6
	if ((pc.and."777).ne.0) goto 80
	if (pc.eq.0) lbn=lbn-"200
81	if ((pc/"1000.and."177).ne.lbn) goto 80
	PC=PC00AC
	PC0=PC
	GOTO 19
11	NK0=NK
	PC0=PC
	call oct((pc0.and."70)/8)
	call oct(pc0.and."7)
	nkk=nk
	nk=nk+1
	kb(nk)="72
	if (hetven.ne.0) goto 2
	nk=nk+1
	kb(nk)="11
2	continue
	CALL CMDDEC
	pcx=pc.xor."100000
	IF (NK.Lt.HETVEN.AND.EV.EQ.0.and.pcx.le.pcmx) GOTO 11
	WRITE (1, 3) (KB(BU), BU=1,NK0)
3	FORMAT (X,133A1)
19	NKC=NK
	NK=0
	CALL OCT(PC0)
	DO 5 BI=1,NKC-NKk
5	KB(NK+BI)=KB(NKk+BI)
	NK=NK+NKC-NKk
D	IF (EV.EQ.0.and.
D     +(pc.xor."100000).le.(pcmmov.xor."100000)) GOTO 11! works as pc.le.pcmmov!
D	goto 6
	pcx=pc.xor."100000
	pcmx=pcmmov.xor."100000
	IF (EV.EQ.0.and.pcx.le.pcmx) GOTO 11
6	CALL CLOSE (3)
	GOTO 9
	END

