1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00

Optimization

git-svn-id: svn://svn.cc65.org/cc65/trunk@422 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-10-31 18:53:38 +00:00
parent 39478bcd8b
commit 12026ee98a

View File

@ -7,6 +7,7 @@
.export ldeax
.importzp sreg, ptr4
.macpack generic
ldeax: pla ; Low byte of return address
sta ptr4
@ -24,15 +25,13 @@ ldeax: pla ; Low byte of return address
dey
lda (ptr4),y
tay ; Save low byte
clc
lda #4
adc ptr4
sta ptr4
lda ptr4+1
adc #$00
pha ; High byte of new return address
lda ptr4
pha ; Low byte of new return address
tya ; Low byte of fetched value
rts
; Calculate the return address (remember: RTS address is one low) and
; jump to it
lda ptr4
add #5
sta ptr4
bcc @L9
inc ptr4+1
@L9: jmp (ptr4)