fix signed byte to word casting issue uw = 8888 + (bb as ubyte)

This commit is contained in:
Irmen de Jong 2023-10-17 22:51:49 +02:00
parent 893b383bdf
commit d88c09b098
4 changed files with 7 additions and 13 deletions

View File

@ -1830,8 +1830,9 @@ internal class AssignmentAsmGen(private val program: PtProgram,
RegisterOrPair.AY,
RegisterOrPair.XY,
in Cx16VirtualRegisters -> {
// cast an ubyte value to a 16 bits register, just assign it and make use of the value extension
return assignExpressionToRegister(value, target.register!!, false)
assignExpressionToRegister(value, RegisterOrPair.A, false)
assignRegisterByte(target, CpuRegister.A, false)
return
}
else -> {}
}

View File

@ -1,9 +1,6 @@
TODO
====
- fix codegen signed byte to word casting issue uw = 8888 + (bb as ubyte)
- remove after(assignment from BeforeAsmAstChanger permanently once issues above fixed
- gfx2/monogfx: use vera auto in/decrement in the flood fill routine (getpixels)
- gfx2: use vera fx fill for horizontal_line of sufficient length?

View File

@ -4,15 +4,11 @@
main {
sub start() {
uword @shared uw = 5555
byte @shared bb = -44
uw = (bb as ubyte) as uword
txt.print_uw(uw) ; 212
txt.nl()
uw = 8888 + (bb as ubyte) ; TODO fix 6502 codegen
uword uw = 8888 + (bb as ubyte)
txt.print_uw(uw) ; 9100
txt.nl()
txt.print_uw(8888 + (bb as ubyte)) ; 9100
txt.nl()
}
}

View File

@ -5,4 +5,4 @@ org.gradle.daemon=true
kotlin.code.style=official
javaVersion=11
kotlinVersion=1.9.10
version=9.5
version=9.5.1