X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fruntime%2Fpusha.s;h=e3d2ba2eeaf519f760fb05afc131956b766426e0;hb=bc6dadb3dbddcb1923c628102aa6342cd356cec0;hp=d8e90ac3e338710da7716b6b2afe6dee56378079;hpb=4a7642e98c404883e6757e5dabd36e3a9c8431a9;p=cc65 diff --git a/libsrc/runtime/pusha.s b/libsrc/runtime/pusha.s index d8e90ac3e..e3d2ba2ee 100644 --- a/libsrc/runtime/pusha.s +++ b/libsrc/runtime/pusha.s @@ -4,22 +4,28 @@ ; CC65 runtime: Push value in a onto the stack ; - .export pushaysp, pusha + .export pusha0sp, pushaysp, pusha .importzp sp ; Beware: The optimizer knows about this function! +pusha0sp: + ldy #$00 pushaysp: lda (sp),y -pusha: ldy sp - beq @L1 - dec sp - ldy #0 - sta (sp),y - rts +pusha: ldy sp ; (3) + beq @L1 ; (6) + dec sp ; (11) +.ifpc02 + sta (sp) +.else + ldy #0 ; (13) + sta (sp),y ; (19) +.endif + rts ; (25) -@L1: dec sp+1 - dec sp - sta (sp),y - rts +@L1: dec sp+1 ; (11) + dec sp ; (16) + sta (sp),y ; (22) + rts ; (28)