mirror of
https://github.com/irmen/prog8.git
synced 2024-12-23 09:32:43 +00:00
fix cpu register overwrites when using @(...) arguments to an asmsub
This commit is contained in:
parent
e941d2665a
commit
6c8c8e11cc
@ -82,7 +82,7 @@ internal class FunctionCallAsmGen(private val program: PtProgram, private val as
|
|||||||
is PtAddressOf -> false
|
is PtAddressOf -> false
|
||||||
is PtIdentifier -> false
|
is PtIdentifier -> false
|
||||||
is PtMachineRegister -> false
|
is PtMachineRegister -> false
|
||||||
is PtMemoryByte -> false
|
is PtMemoryByte -> return usesOtherRegistersWhileEvaluating(arg.address)
|
||||||
is PtNumber -> false
|
is PtNumber -> false
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
TODO
|
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)
|
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()" )
|
assembler, imageviewer is bigger than before (since commit "added string.lstripped() and string.ltrimmed()" )
|
||||||
|
|
||||||
|
@ -6,40 +6,24 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
sub start() {
|
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 name1 = "name1"
|
||||||
str name2 = "name2"
|
str name2 = "name2"
|
||||||
uword[] @split names = [name1, name2, "name3"]
|
uword[] @split names = [name1, name2, "name3"]
|
||||||
uword[] addresses = [0,0,0]
|
uword[] addresses = [0,0,0]
|
||||||
names = [1111,2222,3333]
|
names = [1111,2222,3333]
|
||||||
addresses = names
|
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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user