diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt index af0b418c5..96a8ae60e 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt @@ -975,8 +975,8 @@ internal class AssignmentAsmGen(private val program: Program, // byte to byte, just assign assignExpressionToRegister(value, target.register!!, targetDt==DataType.BYTE || targetDt==DataType.WORD) } else if(valueDt in ByteDatatypes && targetDt in WordDatatypes) { - // byte to word, assign and zero the msb - TODO("cast byte to word: $value") + // byte to word, just assign + assignExpressionToRegister(value, target.register!!, targetDt==DataType.WORD) } else throw AssemblyError("can't cast $valueDt to $targetDt, this should have been checked in the astchecker") diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 6d8c92413..499a55bd8 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -4,7 +4,6 @@ TODO For next release ^^^^^^^^^^^^^^^^ - vm: implement remaining sin/cos functions in virtual/math.p8 and merge tables -- fix "can't cast BYTE to UWORD this should have been checked in the astchecker" crash ... diff --git a/examples/cx16/sincos.p8 b/examples/cx16/sincos.p8 index c29dd4537..92ea4d1d6 100644 --- a/examples/cx16/sincos.p8 +++ b/examples/cx16/sincos.p8 @@ -47,9 +47,9 @@ main { for pixelxb in 0 to 255 { pixelys = math.cos8(pixelxb) / 2 - graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error + graphics.plot(pixelxb, pixelys+90 as uword) pixelys = math.sin8(pixelxb) / 2 - graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error + graphics.plot(pixelxb, pixelys+90 as uword) } } @@ -69,9 +69,9 @@ main { for pixelxb in 0 to 179 { pixelys = math.cosr8(pixelxb) / 2 - graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error + graphics.plot(pixelxb, pixelys+90 as uword) pixelys = math.sinr8(pixelxb) / 2 - graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error + graphics.plot(pixelxb, pixelys+90 as uword) } }