]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/pushax.s
Added mouse module from C64
[cc65] / libsrc / runtime / pushax.s
index 077c52ca8c4e1f933287795c1a12a827e1c97fd1..22b71e0596794d8c4f9cf1594b00264665c6ff1e 100644 (file)
@@ -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
+       lda     sp
+       sec
+       sbc     #2
+       sta     sp              ; (13)
+       bcs     @L1
+       dec     sp+1
+@L1:   ldy     #1
+       txa                     ; (20)
+       sta     (sp),y
+       pla
+       dey
+       sta     (sp),y          ; (38)
+       rts
 
-                   
+.endproc