mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
fix jump jsr/rts
This commit is contained in:
parent
fdf9054b99
commit
fbb4ba4bd8
@ -422,14 +422,15 @@ class CodeGenerator:
|
||||
targetstr = stmt.target.name or Parser.to_hex(stmt.address)
|
||||
else:
|
||||
raise TypeError("call sub target should be mmapped")
|
||||
if stmt.is_goto:
|
||||
self.p("\t\tjmp " + targetstr)
|
||||
return
|
||||
clobbered = set() # type: Set[str]
|
||||
if targetdef.clobbered_registers:
|
||||
if stmt.preserve_regs: # @todo make this work with the separate assignment statements for the parameters.. :(
|
||||
clobbered = targetdef.clobbered_registers
|
||||
with self.preserving_registers(clobbered):
|
||||
self.p("\t\tjsr " + targetstr)
|
||||
if stmt.is_goto:
|
||||
self.p("\t\trts")
|
||||
return
|
||||
if isinstance(stmt.target, ParseResult.IndirectValue):
|
||||
if stmt.target.name:
|
||||
|
@ -15,7 +15,7 @@
|
||||
const .float constf = 3.4556677
|
||||
const .text constt = "derp"
|
||||
|
||||
subx sub1 () -> () = $ffdd
|
||||
subx sub1 () -> (X?) = $ffdd
|
||||
|
||||
|
||||
bar
|
||||
@ -24,7 +24,7 @@ bar
|
||||
go [AX]
|
||||
go [var1]
|
||||
go [mem1]
|
||||
go [#mem1] ; @todo error: indirection of address-of makes no sense
|
||||
go [#mem1] ; @todo error: indirection of address-of makes no sense, should have outputted jmp mem1 instead of jmp(mem1)
|
||||
go [$c2.word]
|
||||
go [$c2dd.word]
|
||||
go $c000
|
||||
|
Loading…
Reference in New Issue
Block a user