]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/add.s
Added mouse module from C64
[cc65] / libsrc / runtime / add.s
index 49c7eca96f796655e4ec8774c2273f01824b3e0d..b22e16ecc72b2f517d84473fa38d632e2a455cef 100644 (file)
 tosadda0:
        ldx     #0
 tosaddax:
-       ldy     #0
-       clc
-       adc     (sp),y          ; lo byte
+       clc
+.ifpc02
+       adc     (sp)            ; 65C02 version - saves 2 cycles
+       ldy     #1
+.else
+       ldy     #0
+       adc     (sp),y          ; lo byte
+       iny
+.endif
                pha                     ; save it
-       txa
-       iny
-       adc     (sp),y          ; hi byte
+       txa
+       adc     (sp),y          ; hi byte
        tax
        clc
        lda     sp