mirror of
https://github.com/cc65/cc65.git
synced 2024-11-07 21:10:15 +00:00
29 lines
394 B
ArmAsm
29 lines
394 B
ArmAsm
|
;
|
||
|
; Ullrich von Bassewitz, 25.10.2000
|
||
|
;
|
||
|
; CC65 runtime: Decrement the stackpointer by value in y
|
||
|
;
|
||
|
|
||
|
.export subysp
|
||
|
.importzp sp, tmp1
|
||
|
|
||
|
.proc subysp
|
||
|
|
||
|
pha ; Save A
|
||
|
sty tmp1 ; Save the value
|
||
|
lda sp ; Get lo byte
|
||
|
sec
|
||
|
sbc tmp1 ; Subtract y value
|
||
|
sta sp ; Put result back
|
||
|
bcs @L1
|
||
|
dec sp+1
|
||
|
@L1: pla ; Restore A
|
||
|
rts ; Done
|
||
|
|
||
|
.endproc
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|