]> git.sur5r.net Git - cc65/commitdiff
Some more 6502 code
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 27 Nov 2000 23:37:53 +0000 (23:37 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 27 Nov 2000 23:37:53 +0000 (23:37 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@485 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/incsp2.s
libsrc/runtime/sub.s

index 959294326f59b52b45b60074d6719d53550e732d..9893bebdcf475c9dad7d1ee38183e74fa2a5979a 100644 (file)
        ldy     #1
        lda     (sp),y          ; get hi byte
                tax                     ; into x
+.ifpc02        
+       lda     (sp)            ; get lo byte
+.else
        dey
        lda     (sp),y          ; get lo byte
+.endif
 
 .endproc
 
index 9108b271059d1d5f8b8756b24ea04f0b7d76fd2f..1cefd9ac76668510a78076023757b489f9637119 100644 (file)
@@ -5,7 +5,7 @@
 ;
 
                .export         tossuba0, tossubax
-       .import         addysp1         
+       .import         addysp1
        .importzp       sp, ptr1
 
 ;
 tossuba0:
        ldx     #0
 tossubax:
-       ldy     #0
        sta     ptr1
        stx     ptr1+1
-       lda     (sp),y          ; lo byte
-       sec
+.ifpc02
+       lda     (sp),y          ; Get lo byte
+       ldy     #1              ; Hi index
+.else
+       ldy     #0
+       lda     (sp),y          ; Lo byte
+       iny                     ; Hi index
+.endif
+       sec                        
        sbc     ptr1
        sta     ptr1            ; save lo byte
-       iny
        lda     (sp),y
        sbc     ptr1+1
        tax