mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +00:00
23c35f27f8
git-svn-id: svn://svn.cc65.org/cc65/trunk@2507 b7a2c559-68d2-44c3-8de9-860c34a00d81
48 lines
795 B
ArmAsm
48 lines
795 B
ArmAsm
;
|
|
; Ullrich von Bassewitz, 25.10.2000
|
|
;
|
|
; CC65 runtime: Increment the stackpointer by 2. For performance reasons,
|
|
; this modules does also contain the popax function.
|
|
|
|
.export popax, incsp2
|
|
.importzp sp
|
|
|
|
.macpack cpu
|
|
|
|
; Pop a/x from stack. This function will run directly into incsp2
|
|
|
|
.proc popax
|
|
|
|
ldy #1
|
|
lda (sp),y ; get hi byte
|
|
tax ; into x
|
|
.if (.cpu .bitand ::CPU_ISET_65SC02)
|
|
lda (sp) ; get lo byte
|
|
.else
|
|
dey
|
|
lda (sp),y ; get lo byte
|
|
.endif
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
.proc incsp2
|
|
|
|
inc sp ; 5
|
|
beq @L1 ; 2
|
|
inc sp ; 5
|
|
beq @L2 ; 2
|
|
rts
|
|
|
|
@L1: inc sp ; 5
|
|
@L2: inc sp+1 ; 5
|
|
rts
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
|
|