2000-10-25 19:53:22 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 25.10.2000
|
|
|
|
;
|
|
|
|
; CC65 runtime: Pop a from stack
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export popa
|
|
|
|
.importzp sp
|
2000-10-25 19:53:22 +00:00
|
|
|
|
2003-10-10 17:52:12 +00:00
|
|
|
.macpack cpu
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc popa
|
2000-10-25 19:53:22 +00:00
|
|
|
|
2003-10-10 17:52:12 +00:00
|
|
|
.if (.cpu .bitand ::CPU_ISET_65SC02)
|
2013-05-09 11:56:54 +00:00
|
|
|
lda (sp)
|
2000-11-28 13:27:42 +00:00
|
|
|
.else
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #0 ; (2)
|
|
|
|
lda (sp),y ; (7) Read byte
|
2000-11-28 13:27:42 +00:00
|
|
|
.endif
|
2013-05-09 11:56:54 +00:00
|
|
|
inc sp ; (12)
|
|
|
|
beq @L1 ; (14)
|
|
|
|
rts ; (20)
|
2000-11-28 13:27:42 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
@L1: inc sp+1
|
|
|
|
rts
|
2000-10-25 19:53:22 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|