From 4dee8b604845e81aeaf17b2234f91730c7305afe Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 19 Oct 2020 02:38:26 +0200 Subject: [PATCH] remove superfluous value eval --- .../assignment/AugmentableAssignmentAsmGen.kt | 21 +++++------ examples/test.p8 | 36 +++++++------------ 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/compiler/src/prog8/compiler/target/c64/codegen/assignment/AugmentableAssignmentAsmGen.kt b/compiler/src/prog8/compiler/target/c64/codegen/assignment/AugmentableAssignmentAsmGen.kt index 136b85c04..f7dc0bccf 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen/assignment/AugmentableAssignmentAsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen/assignment/AugmentableAssignmentAsmGen.kt @@ -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 diff --git a/examples/test.p8 b/examples/test.p8 index 36762b6c2..6e6183a3a 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -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() }