; Beware^2: The optimizer knows about the value of Y after the function
; returns!
-pushax: ldy sp
- beq @L1
- dey
- beq @L2
- dey
-@L0: sty sp
- ldy #0 ; get index
- sta (sp),y ; store lo byte
- pha ; save it
- txa ; get hi byte
- iny ; bump idx
- sta (sp),y ; store hi byte
- pla ; get A back
- rts ; done
+.proc pushax
-@L1: dey
-@L2: dey
- dec sp+1
- jmp @L0
+ pha ; (3)
+ lda sp ; (6)
+ sec ; (8)
+ sbc #2 ; (10)
+ sta sp ; (13)
+ bcs @L1 ; (17)
+ dec sp+1 ; (+5)
+@L1: ldy #1 ; (19)
+ txa ; (21)
+ sta (sp),y ; (27)
+ pla ; (31)
+ dey ; (33)
+ sta (sp),y ; (38)
+ rts ; (44)
-
+.endproc