]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/lpush.s
no TGI_ERR_NO_MEM or TGI_ERR_NO_IOCB anymore: replaced by TGI_ERR_NO_RES
[cc65] / libsrc / runtime / lpush.s
index 7724f499b756f05f94f35b47bbc5c9e0a653190b..6b7312a4aac33ff3e36291cfb16725ce5b6f92bb 100644 (file)
@@ -16,19 +16,19 @@ push0ax:
        sty     sreg
        sty     sreg+1
 pusheax:
+       pha                     ; decsp will destroy A (but not X)
        jsr     decsp4
-       pha
-       ldy     #0
-       sta     (sp),y
-       iny
-       txa
+       ldy     #3
+       lda     sreg+1
        sta     (sp),y
-       iny
+       dey
        lda     sreg
        sta     (sp),y
-       iny
-       lda     sreg+1
+       dey
+       txa
        sta     (sp),y
+       dey
        pla
+       sta     (sp),y
        rts