mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-24 17:31:46 +00:00
Include final RTS when emitting trampolines for indirect calls.
This commit is contained in:
parent
b4f5d60ad3
commit
6c1c1cb153
@ -12,6 +12,7 @@ History of SixtyPical
|
||||
* Added `define name routine {...}` syntax; `routine name {...}` is now legacy.
|
||||
* Removed the evaluator. The reference implementation only analyzes and compiles.
|
||||
* Fixed bug where index register wasn't required to be initialized before table access.
|
||||
* Fixed bug where trampolines for indirect calls weren't including a final `RTS`.
|
||||
|
||||
0.10
|
||||
----
|
||||
|
@ -78,6 +78,7 @@ class Compiler(object):
|
||||
for location, label in self.trampolines.iteritems():
|
||||
self.emitter.resolve_label(label)
|
||||
self.emitter.emit(JMP(Indirect(self.labels[location.name])))
|
||||
self.emitter.emit(RTS())
|
||||
|
||||
# initialized data
|
||||
for defn in program.defns:
|
||||
|
@ -593,14 +593,14 @@ Indirect call.
|
||||
| call foo
|
||||
| }
|
||||
= $080D LDA #$1B
|
||||
= $080F STA $0821
|
||||
= $080F STA $0822
|
||||
= $0812 LDA #$08
|
||||
= $0814 STA $0822
|
||||
= $0814 STA $0823
|
||||
= $0817 JSR $081E
|
||||
= $081A RTS
|
||||
= $081B LDX #$C8
|
||||
= $081D RTS
|
||||
= $081E JMP ($0821)
|
||||
= $081E JMP ($0822)
|
||||
= $0821 RTS
|
||||
|
||||
goto.
|
||||
@ -656,22 +656,23 @@ Copying to and from a vector table.
|
||||
| }
|
||||
= $080D LDX #$00
|
||||
= $080F LDA #$35
|
||||
= $0811 STA $083B
|
||||
= $0811 STA $083C
|
||||
= $0814 LDA #$08
|
||||
= $0816 STA $083C
|
||||
= $0819 LDA $083B
|
||||
= $081C STA $083D,X
|
||||
= $081F LDA $083C
|
||||
= $0822 STA $093D,X
|
||||
= $0825 LDA $083D,X
|
||||
= $0828 STA $083B
|
||||
= $082B LDA $093D,X
|
||||
= $082E STA $083C
|
||||
= $0816 STA $083D
|
||||
= $0819 LDA $083C
|
||||
= $081C STA $083E,X
|
||||
= $081F LDA $083D
|
||||
= $0822 STA $093E,X
|
||||
= $0825 LDA $083E,X
|
||||
= $0828 STA $083C
|
||||
= $082B LDA $093E,X
|
||||
= $082E STA $083D
|
||||
= $0831 JSR $0838
|
||||
= $0834 RTS
|
||||
= $0835 LDX #$C8
|
||||
= $0837 RTS
|
||||
= $0838 JMP ($083B)
|
||||
= $0838 JMP ($083C)
|
||||
= $083B RTS
|
||||
|
||||
### word operations
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user