fix cx16 word sign extend in bitshift

This commit is contained in:
Irmen de Jong 2020-09-04 22:37:42 +02:00
parent fe4e0e9835
commit a6f3c84e28
2 changed files with 4 additions and 9 deletions

View File

@ -1 +1 @@
4.1
4.2-SNAPSHOT

View File

@ -103,14 +103,9 @@ internal class ExpressionsAsmGen(private val program: Program, private val asmge
asmgen.out("""
lda P8ESTACK_LO+1,x
ora #$7f
bmi +""")
if(CompilationTarget.machine.cpu==CpuType.CPU65c02)
asmgen.out("""
+ stz P8ESTACK_HI+1,x""")
else
asmgen.out("""
lda #0
+ sta P8ESTACK_HI+1,x""")
bmi +
lda #0
+ sta P8ESTACK_HI+1,x""")
}
DataType.FLOAT -> asmgen.out(" jsr c64flt.stack_b2float")
in PassByReferenceDatatypes -> throw AssemblyError("cannot cast to a pass-by-reference datatype")