diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/FunctionCallAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/FunctionCallAsmGen.kt index 381b1e90e..1c579c43d 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/FunctionCallAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/FunctionCallAsmGen.kt @@ -82,7 +82,7 @@ internal class FunctionCallAsmGen(private val program: PtProgram, private val as is PtAddressOf -> false is PtIdentifier -> false is PtMachineRegister -> false - is PtMemoryByte -> false + is PtMemoryByte -> return usesOtherRegistersWhileEvaluating(arg.address) is PtNumber -> false else -> true } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index eaa5453f0..4342702ac 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,8 +1,6 @@ TODO ==== -fix bug: txt.setchr(x, y, @(bytes+$1000)) bytes++ doesn't fill the whole screen only the first 256 bytes or something - fix TODO's to assign from and to split arrays (BuiltinFuncGen + BuiltinFunctionAsmGen) -- cannot use simple single memcopy here (6502 + IR) assembler, imageviewer is bigger than before (since commit "added string.lstripped() and string.ltrimmed()" ) diff --git a/examples/test.p8 b/examples/test.p8 index 5e6381373..b69458724 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -6,40 +6,24 @@ main { sub start() { + ubyte x + ubyte y + uword bytes = $a000 + + for y in 0 to 59 { + for x in 0 to 79 { + txt.setchr(x, y, @(bytes+$1000)) + bytes++ + } + } + } + + sub stringcopy() { str name1 = "name1" str name2 = "name2" uword[] @split names = [name1, name2, "name3"] uword[] addresses = [0,0,0] names = [1111,2222,3333] addresses = names - ;foo("zzz") - } - - sub foo (str sarg) { - ubyte[3] svar - txt.print_uwhex(svar, true) - txt.nl() - txt.print_uwhex(&svar, true) - txt.nl() - txt.print_uwhex(&svar[2], true) - txt.nl() - cx16.r1L = 3 - txt.print_uwhex(&svar[cx16.r1L], true) - txt.nl() - txt.nl() - - txt.print_uwhex(sarg, true) - txt.nl() - txt.print_uwhex(&sarg, true) - txt.nl() - txt.print_uwhex(sarg+2, true) - txt.nl() - cx16.r0 = &sarg[2] - txt.print_uwhex(cx16.r0, true) ; TODO should be the same as the previous one sarg+2 (13)! - txt.nl() - cx16.r1L=3 - cx16.r0 = &sarg[cx16.r1L] - txt.print_uwhex(cx16.r0, true) ; TODO should be the same as the previous one sarg+2 (13)! - txt.nl() } }