]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/and.s
no TGI_ERR_NO_MEM or TGI_ERR_NO_IOCB anymore: replaced by TGI_ERR_NO_RES
[cc65] / libsrc / runtime / and.s
index cf1d10ead8004e3f4aebaabba98a8453380989d8..c38b47bb23b7abcb8bb0fe98d25ba987d46a4aea 100644 (file)
@@ -8,16 +8,23 @@
        .import         addysp1
        .importzp       sp, ptr4
 
+        .macpack        cpu
+
 tosanda0:
        ldx     #$00
 tosandax:
-       ldy     #0
+.if (.cpu .bitand CPU_ISET_65SC02)
+       and     (sp)            ; 65SC02 version, saves 2 cycles and 1 byte
+       ldy     #1
+.else
+       ldy     #0
                and     (sp),y
-       sta     ptr4
-       iny
-       txa
-       and     (sp),y
+       iny
+.endif
+               pha
+       txa
+       and     (sp),y
        tax
-       lda     ptr4
+       pla
        jmp     addysp1         ; drop TOS, set condition codes