From a6f3c84e28c495f17207e219543b1e10f5f8fe59 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 4 Sep 2020 22:37:42 +0200 Subject: [PATCH] fix cx16 word sign extend in bitshift --- compiler/res/version.txt | 2 +- .../compiler/target/c64/codegen/ExpressionsAsmGen.kt | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/compiler/res/version.txt b/compiler/res/version.txt index 7d5c902e7..9fb9399cc 100644 --- a/compiler/res/version.txt +++ b/compiler/res/version.txt @@ -1 +1 @@ -4.1 +4.2-SNAPSHOT diff --git a/compiler/src/prog8/compiler/target/c64/codegen/ExpressionsAsmGen.kt b/compiler/src/prog8/compiler/target/c64/codegen/ExpressionsAsmGen.kt index a32ee5948..38d3d2209 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen/ExpressionsAsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen/ExpressionsAsmGen.kt @@ -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")