.title xlat .ident /09may4/ .mcall (at)always,ch.mne,st.flg,ct.mne always ch.mne st.flg ct.mne .mcall (at)xmit .mcall (at)genswt,error,genedt .mcall (at)search,scan,scanw,zap .mcall (at)bisbic .mcall (at)sdebug,ndebug .globl secini, stmnt .globl edmask, seted, setmax, propc .globl cndwrd, lsybas, lsbset, lc.cnd, opclas .globl exmflg, err.u .globl codrol, secrol, psarol, edtrol .globl symrol, pstrol .globl dflcnd, dflgev, dflgbm, dflgdg .globl wrdsym .globl crfdef, crfref .globl clcfgs, clcloc, clcmax .globl clcnam, clcsec, cpopj, cradix, cvtnum .globl edmask, endvec, errbts, expflg .globl flags, getchr, getnb, getsym, insert .globl lsrch, mode, psdflt .globl r50dot .globl sector, setnb, setpf0, setpf1 .globl setsec, setsym, setxpr, stcode .globl symbol, symbeg, tstarg, value .globl abstrm, abstst .globl expr, exprg, relexp .globl reltst, setdsp, setimm .globl tstr50, mulr50 .globl mactst .globl setcli .globl absexp, chrpnt .globl savreg, xmit0 .globl gsarg, gsargf, argcnt .globl aexp, asgmtf, cndmex, cttbl .globl endflg .globl lblend, lcflag .sbttl statement processor xitsec ;start in default sector stmnt: mov cndwrd,r0 ;in conditional? bis cndmex,r0 ; or mexit? bne 40$ ; yes, branch if suppressed call getsym beq 20$ cmp r5,#ch.col ; ":" beq label cmp r5,#ch.equ ; "=" bne 1$ ; no jmp asgmt ;yes, process it 1$: .if ndf xmacro call mactst ;test for a macro bne 42$ ; yes, already processed .endc search pstrol beq 30$ call crfref 10$: jmp propc ;process op code 20$: .if ndf xedlsb mov #10.,r2 ;not symbol, perhaps local symbol? mov chrpnt,symbeg ;in case of re-scan call cvtnum beq 30$ ; no cmp r5,#ch.dol ;number, terminated by "$"? bne 30$ ; no call getnb cmp r5,#ch.col bne 30$ .if ndf rsx11d mov clcloc,r0 sub lsybas,r0 ;compute local offset bit #177400,r0 ;in range beq 21$ ; yes error 70,a, ;no, error .endc 21$: call lsrch ;yes, do a local symbol search br labelf ;exit through label processor .endc 30$: call setsym ;reset char pointer and flags tstb cttbl(r5) ble 42$ ;null if end of line mov #wrdsym,r1 ;neither, fudge ".word" directive mov #symbol,r2 xmit 4 br 10$ 40$: call setcli ;unsat conditional, test directive bmi 41$ ; branch if eof bit #dflcnd,r0 ;conditional? bne 10$ ; yes, process it bis #lc.cnd,lcflag ;mark as unsat conditional 41$: clr r5 42$: return ;ignore line setcli: 1$: call getsym ;try for symbol .if ndf xedlsb bne 3$ ;branch if found bitb #ct.num,cttbl(r5) ;perhaps a local? beq 5$ ; no 2$: call getchr ;perhaps, test next bitb #ct.alp!ct.num,cttbl(r5) ;alpha/numeric? bne 2$ ; yes, try again call setnb ;no, bypass any blanks .iff beq 5$ ; exit if no symbol .endc 3$: cmp r5,#ch.equ ;assignment (=)? beq 5$ ; yes, ignore this line cmp r5,#ch.col ;label (:)? bne 4$ ; no call getnb ;yes, bypass colon br 1$ ; and continue 4$: search pstrol ;try for op-code mov mode,r0 ;mode to r0 bpl 6$ ;branch if directive 5$: clr r0 ;false 6$: return label: ;label processor .enabl lsb cmp symbol,r50dot ;period? beq 4$ ; yes, error .if ndf xedlsb call lsbset ;flag start of new local symbol block .endc search symrol ;no, search the symbol table call crfdef labelf: call setxpr ;set expression registers bit #dfgflg,(r3) ; <<< REEDS has it been marked 'x' beq 33$ ; <<< no, thats OK bic #dfgflg!glbflg,(r3); <<,r0 ;clear all but relocation flag bis #defflg!lblflg,r0 ;flag as label .if ne,mk.symbol bis dfgtmp,r0 .endc bis r0,(r3) ;set mode mov clcloc,(r4) ; and current location br 3$ ;insert 1$: bit #lblflg,(r3) ;defined, as label? beq 2$ ; no, invalid cmp clcloc,(r4) ;has anybody moved? bne 2$ ; yes cmpb clcsec,(r2) ;same sector? beq 3$ ; yes, ok 2$: error 32,p,;no, flag error bis #mdfflg,(r3) ;flag as multiply defined 3$: call insert ;insert/update call setpf0 ;be sure to print location field br 5$ 4$: error 33,q, 5$: mov chrpnt,lblend ;mark end of label .if ne,mk.symbol clr dfgtmp entsec impure dfgtmp: .blkw xitsec .endc jmp stmnt ;try for more .dsabl lsb .sbttl assignment processor asgmt: call getnb ;bypass "=" .if ne,mk.symbol cmp r5,#ch.equ bne 10$ mov #glbflg,dfgtmp call getnb 10$: cmp r5,#ch.mul bne 32$ bis #200,dfgtmp call getnb 32$: .iftf mov #symbol+4,r1 ;set mix-master register mov -(r1),-(sp) ;stack symbol mov -(r1),-(sp) call relexp ;get non-external expression mov (sp)+,(r1)+ ;restore symbol mov (sp)+,(r1)+ bit #err.u,errbts ;any undefined's? bne asgmtx ; yes, don't define asgmtf: call setpf1 ;set listing field call setxpr ;set expression registers bit #err.a,errbts bne asgmtx bis #defflg,(r3) ;flag as defined mov (r3),-(sp) ;no, stack value mov (r4),-(sp) search symrol ;search symbol table mov (sp)+,(r4) ;restore value bic #^c,(r3) bis (sp)+,(r3) cmp (r1),r50dot ;messing with the pc? beq 1$ ; yes .ift bis dfgtmp,(r3) ;i hope .iftf call insert ;insert new value br asgmtx 1$: cmpb (r2),clcsec ;same sector? bne 2$ ; no, error mov (r4),clcloc ;yes, set new location br asgmtx 2$: error 34,m,