X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fruntime%2Fpushax.s;h=d9efe7c0e636f4b52000c472b9ca410b66f04152;hb=463712217c7cfa64414da8d964fb24de0e7e78cd;hp=077c52ca8c4e1f933287795c1a12a827e1c97fd1;hpb=4a7642e98c404883e6757e5dabd36e3a9c8431a9;p=cc65 diff --git a/libsrc/runtime/pushax.s b/libsrc/runtime/pushax.s index 077c52ca8..d9efe7c0e 100644 --- a/libsrc/runtime/pushax.s +++ b/libsrc/runtime/pushax.s @@ -15,24 +15,21 @@ pusha0: ldx #0 ; 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