]> git.sur5r.net Git - cc65/blob - libsrc/runtime/and.s
goto.c warning fix for implicit truncation
[cc65] / libsrc / runtime / and.s
1 ;
2 ; Ullrich von Bassewitz, 05.08.1998
3 ;
4 ; CC65 runtime: and on ints
5 ;
6
7         .export         tosanda0, tosandax
8         .import         addysp1
9         .importzp       sp, ptr4
10
11         .macpack        cpu
12
13 tosanda0:
14         ldx     #$00
15 tosandax:
16 .if (.cpu .bitand CPU_ISET_65SC02)
17         and     (sp)            ; 65SC02 version, saves 2 cycles and 1 byte
18         ldy     #1
19 .else
20         ldy     #0
21         and     (sp),y
22         iny
23 .endif
24         pha
25         txa
26         and     (sp),y
27         tax
28         pla
29         jmp     addysp1         ; drop TOS, set condition codes
30