
 ttl Code generation - 4
 pag

*
* Special operators group II
*

spclt lda moprtr,y get operator
 cmpa #50 is it arrow?
 lbeq arrow
 cmpa #53 is it boolean and?
 beq band
 cmpa #54
 beq bor is it boolean or?
 cmpa #55 is it and term?
 lbeq bandt
 bra bort do or term

*
* process boolean or
*

bor lbsr gtbra generate branch to true
 clr dcont
 andcc #$fb set true
 rts return

*
* process boolean and
*

band clr dcont
 tst cndlf doing conditional?
 beq band4
 ldd flab false label set?
 bne band4
 tfr y,x get matrix pointer
band2 leax MATSIZ,x go to next entry
 lda 0,x get operator
 beq band5
 cmpa #55 is it and term?
 bne band2 keep looking if not
 lda MATSIZ,x get next operator
 beq band6 is it term
 lbsr nxtlb1 generate new label
 std flab make it false label
band4 lbsr gfbra generate false branch
band5 andcc #$fb set true
 rts return
band6 lbsr gncbra generate branch
 ldd cexlab get conditional exit label
 lbsr outlb output it
 bra band5 exit true

*
* process boolean or terminator
*

bort clr dcont d free now
 lda MATSIZ,y get next operator
 beq bort4 term?
 cmpa #54 is it '||'?
 beq bort6
 cmpa #55 is it && term?
 beq bort2
 cmpa #56 is it || term?
 bne bort5
bort2 tfr y,x get matrix pointer
bort3 leax MATSIZ,x get next entry
 lda MATSIZ,x get next operator
 cmpa #55 is it && term?
 beq bort3
 cmpa #56 is it || term?
 beq bort3
 cmpa #54 is it ||?
 beq bort6
bort4 inc dtlab set delay flag
 rts return
bort5 lbsr setzoc output one zero code
bort6 andcc #$fb set true
 rts return

*
* process boolean and term
*

bandt clr dcont free up d
 lda MATSIZ,y get operator
 beq bandt4 term?
 cmpa #53 is it &&?
 beq bandt6
 cmpa #55 is it && term?
 beq bandt2
 cmpa #56 is it || term?
 bne bandt5
bandt2 tfr y,x get matrix pointer
bandt3 leax MATSIZ,x next entry
 lda MATSIZ,x get next operator
 cmpa #55 is it && term?
 beq bandt3
 cmpa #56 is it || term?
 beq bandt3
 cmpa #53 is it &&?
 beq bandt6
bandt4 inc dflab set delay flag
 rts return
bandt5 lbsr setzoc output one zero code
bandt6 andcc #$fb set true
 rts return

*
* process arrow operator
*

arrow ldd op1clh get type of op1
 cmpd #(PTR<<4)|STRUCT is it ptr to struct?
 bne arrowr
 ldd stnam get name
 bne arrowr
 ldd op1adr point to op
 std stnam
 clr revops
 lbsr ldfop do load of op
 lda matlev get matrix level
 ldb #1
 inca
 cmpa xcont ptr in x?
 beq arrow3
 incb show in y
arrow3 stb stref set ref type
 ldd #0
 std stoff clear offset
 lbra dotop4
arrowr clra set error
 rts return


