mirror of
https://github.com/irmen/prog8.git
synced 2024-11-27 03:50:27 +00:00
added a few more simple special codegen segements for the logic operators on a memmory-read
This commit is contained in:
parent
5ee36c897d
commit
71fec4c555
@ -689,6 +689,18 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
||||
sbc P8ZP_SCRATCH_B1
|
||||
sta $name""")
|
||||
}
|
||||
"|", "or" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" ora $name | sta $name")
|
||||
}
|
||||
"&", "and" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" and $name | sta $name")
|
||||
}
|
||||
"^", "xor" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" eor $name | sta $name")
|
||||
}
|
||||
// TODO: tuned code for more operators
|
||||
else -> {
|
||||
inplaceModification_byte_value_to_variable(name, dt, operator, memread)
|
||||
@ -720,6 +732,24 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
||||
dec $name+1
|
||||
+""")
|
||||
}
|
||||
"|", "or" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" ora $name | sta $name")
|
||||
}
|
||||
"&", "and" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" and $name | sta $name")
|
||||
if(dt in WordDatatypes) {
|
||||
if(asmgen.isTargetCpu(CpuType.CPU65c02))
|
||||
asmgen.out(" stz $name+1")
|
||||
else
|
||||
asmgen.out(" lda #0 | sta $name+1")
|
||||
}
|
||||
}
|
||||
"^", "xor" -> {
|
||||
exprAsmGen.translateDirectMemReadExpression(memread, false)
|
||||
asmgen.out(" eor $name | sta $name")
|
||||
}
|
||||
// TODO: tuned code for more operators
|
||||
else -> {
|
||||
inplaceModification_word_value_to_variable(name, dt, operator, memread)
|
||||
|
@ -2,6 +2,8 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
- test all examples before release of the new version
|
||||
|
||||
- simplify cx16.joystick_get2() once this cx16 rom issue is resolved: https://github.com/commanderx16/x16-rom/issues/203
|
||||
- c64: make the graphics.BITMAP_ADDRESS configurable (VIC banking)
|
||||
- get rid of all other TODO's in the code ;-)
|
||||
|
@ -3,18 +3,23 @@ main {
|
||||
|
||||
sub start() {
|
||||
|
||||
repeat {
|
||||
ubyte xx
|
||||
ubyte yy=xx
|
||||
ubyte aa
|
||||
ubyte bb
|
||||
ubyte cc
|
||||
ubyte dd
|
||||
}
|
||||
|
||||
repeat {
|
||||
xx=1
|
||||
yy=xx
|
||||
}
|
||||
xx |= 44
|
||||
xx &= 44
|
||||
xx ^= 44
|
||||
|
||||
xx |= @($d020)
|
||||
xx &= @($d020)
|
||||
xx ^= @($d020)
|
||||
|
||||
uword ww
|
||||
|
||||
ww |= $4433
|
||||
ww &= $4433
|
||||
ww ^= $4433
|
||||
ww |= @($d020)
|
||||
ww &= @($d020)
|
||||
ww ^= @($d020)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user