mirror of
https://github.com/irmen/prog8.git
synced 2024-09-30 15:57:06 +00:00
fix TODO crash on uword[0] = uword[0] or 128 (byte register assign to word array)
This commit is contained in:
parent
ead8c59bda
commit
48f09f71ab
@ -2952,10 +2952,22 @@ internal class AssignmentAsmGen(private val program: PtProgram,
|
||||
storeRegisterAInMemoryAddress(target.memory!!)
|
||||
}
|
||||
TargetStorageKind.ARRAY -> {
|
||||
if(assignAsWord)
|
||||
TODO("assign register byte as word into Array not yet supported")
|
||||
if(assignAsWord) {
|
||||
when(register) {
|
||||
CpuRegister.A -> {}
|
||||
CpuRegister.X -> asmgen.out(" txa")
|
||||
CpuRegister.Y -> asmgen.out(" tya")
|
||||
}
|
||||
if(extendWord) {
|
||||
asmgen.signExtendAYlsb(if(target.datatype in SignedDatatypes) DataType.BYTE else DataType.UBYTE)
|
||||
} else {
|
||||
asmgen.out(" ldy #0")
|
||||
}
|
||||
assignRegisterpairWord(target, RegisterOrPair.AY)
|
||||
} else {
|
||||
assignRegisterByteToByteArray(target, register)
|
||||
}
|
||||
}
|
||||
TargetStorageKind.REGISTER -> {
|
||||
when(register) {
|
||||
CpuRegister.A -> when(target.register!!) {
|
||||
|
@ -7,7 +7,6 @@ import io.kotest.assertions.withClue
|
||||
import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.shouldBe
|
||||
import io.kotest.matchers.shouldNotBe
|
||||
import io.kotest.matchers.string.shouldContain
|
||||
import prog8.code.core.Encoding
|
||||
import prog8.code.core.unescape
|
||||
import prog8.code.target.C64Target
|
||||
@ -260,7 +259,7 @@ class TestStringEncodings: FunSpec({
|
||||
errors.errors.size shouldBe 0
|
||||
}
|
||||
|
||||
test("unsupported string encoding iso for C64 compilationtarget") {
|
||||
test("iso string encoding also on C64 compilationtarget") {
|
||||
val source="""
|
||||
main {
|
||||
str string1 = "default"
|
||||
@ -271,12 +270,11 @@ class TestStringEncodings: FunSpec({
|
||||
}
|
||||
}"""
|
||||
val errors = ErrorReporterForTests()
|
||||
compileText(C64Target(), false, source, errors, writeAssembly = false) shouldBe null
|
||||
errors.errors.size shouldBe 1
|
||||
errors.errors[0] shouldContain "text encoding"
|
||||
compileText(C64Target(), false, source, errors, writeAssembly = false) shouldNotBe null
|
||||
errors.errors.size shouldBe 0
|
||||
}
|
||||
|
||||
test("unsupported char encoding iso for C64 compilationtarget") {
|
||||
test("iso char encoding also on C64 compilationtarget") {
|
||||
val source="""
|
||||
main {
|
||||
ubyte char1 = 'd'
|
||||
@ -287,9 +285,8 @@ class TestStringEncodings: FunSpec({
|
||||
}
|
||||
}"""
|
||||
val errors = ErrorReporterForTests()
|
||||
compileText(C64Target(), false, source, errors, writeAssembly = false) shouldBe null
|
||||
errors.errors.size shouldBe 1
|
||||
errors.errors[0] shouldContain "text encoding"
|
||||
compileText(C64Target(), false, source, errors, writeAssembly = false) shouldNotBe null
|
||||
errors.errors.size shouldBe 0
|
||||
}
|
||||
|
||||
test("all encodings supported for Cx16 target") {
|
||||
|
@ -55,7 +55,6 @@ internal object AsciiStringEncoder : IStringEncoding {
|
||||
internal object DummyCompilationTarget : ICompilationTarget {
|
||||
override val name: String = "dummy"
|
||||
override val machine: IMachineDefinition = VirtualMachineDefinition() // not really true but I don't want to implement a full dummy machinedef
|
||||
override val supportedEncodings = setOf(Encoding.PETSCII, Encoding.SCREENCODES, Encoding.ISO)
|
||||
override val defaultEncoding = Encoding.PETSCII
|
||||
|
||||
override fun encodeString(str: String, encoding: Encoding): List<UByte> {
|
||||
|
@ -2,8 +2,6 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
- fix crash on uword[0] = uword[0] or 128
|
||||
- uword scanline_buf = memory("scanline", 320, 0) different result when inside a sub or outside a sub??! (imageviewer iff module)
|
||||
- [on branch: shortcircuit] investigate McCarthy evaluation again? this may also reduce code size perhaps for things like if a>4 or a<2 ....
|
||||
- once VAL_1 is merged into the kernal properly, remove all the workarounds in cx16 floats.parse_f()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user