remove superfluous value eval

This commit is contained in:
Irmen de Jong 2020-10-19 02:38:26 +02:00
parent ec665e0cc1
commit 4dee8b6048
2 changed files with 21 additions and 36 deletions

View File

@ -1244,23 +1244,19 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
remainderWord()
}
"<<" -> {
asmgen.translateExpression(value) // TODO huh is this okay? wasn't this done above already? ****************************************
asmgen.out("""
inx
ldy P8ESTACK_LO,x
beq +
- asl $name
rol $name+1
dey
bne -
ldy P8ESTACK_LO+1,x
beq +
- asl $name
rol $name+1
dey
bne -
+""")
}
">>" -> {
asmgen.translateExpression(value) // TODO huh is this okay? wasn't this done above already? *******************************************
if(dt==DataType.UWORD) {
asmgen.out("""
inx
ldy P8ESTACK_LO,x
ldy P8ESTACK_LO+1,x
beq +
- lsr $name+1
ror $name
@ -1269,8 +1265,7 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
+""") }
else {
asmgen.out("""
inx
ldy P8ESTACK_LO,x
ldy P8ESTACK_LO+1,x
beq +
- lda $name+1
asl a

View File

@ -11,66 +11,56 @@ main {
uword uw
ubyte ub
byte bb
ub = 5
uw = 21111
uw >>= 6
uw <<= ub+1
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 7
uw <<= ub+2
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 8 ; TODO fix this shift!
uw <<= ub+3
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 9 ; TODO fix this shift!
uw <<= ub+4
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 10 ; TODO fix this shift!
uw <<= ub+5
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 11 ; TODO fix this shift!
uw <<= ub+6
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 12 ; TODO fix this shift!
uw <<= ub+7
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 13 ; TODO fix this shift!
uw <<= ub+8
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 14 ; TODO fix this shift!
uw <<= ub+9
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 15 ; TODO fix this shift!
uw <<= ub+10
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 16 ; TODO fix this shift!
uw <<= ub+11
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
uw = 21111
uw >>= 17 ; TODO fix this shift!
uw <<= ub+12
txt.print_uwbin(uw as uword, true)
txt.chrout('\n')
; ub >>= 7
; ub <<= 7
;
; uu >>=7
; uu <<= 7
;
; zz >>=7
; zz <<=7
;
; bb >>=7
; bb <<=7
testX()
}