]> git.sur5r.net Git - cc65/blob - libsrc/runtime/xor.s
cfg/atari-xex.cfg: fix typo in comment
[cc65] / libsrc / runtime / xor.s
1 ;
2 ; Ullrich von Bassewitz, 05.08.1998
3 ; Christian Krueger, 11-Mar-2017, added 65SC02 optimization
4 ;
5 ; CC65 runtime: xor on ints
6 ;
7
8         .export         tosxora0, tosxorax
9         .import         addysp1
10         .importzp       sp, tmp1
11
12         .macpack        cpu
13
14 tosxora0:
15         ldx     #$00
16 tosxorax:
17 .if (.cpu .bitand CPU_ISET_65SC02)
18         eor     (sp)
19         ldy     #1
20 .else
21         ldy     #0
22         eor     (sp),y
23         iny
24 .endif
25         sta     tmp1
26         txa
27         eor     (sp),y
28         tax
29         lda     tmp1
30         jmp     addysp1         ; drop TOS, set condition codes
31