]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lor.s
Added SER_ prefix. Whitespace cleanup
[cc65] / libsrc / runtime / lor.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ; Christian Krueger, 11-Mar-2017, added 65SC02 optimization
4 ;
5 ; CC65 runtime: or on longs
6 ;
7
8         .export         tosor0ax, tosoreax
9         .import         addysp1
10         .importzp       sp, sreg, tmp1
11                                   
12         .macpack        cpu
13
14 tosor0ax:
15 .if (.cpu .bitand ::CPU_ISET_65SC02)
16         stz     sreg
17         stz     sreg+1
18 .else
19         ldy     #$00
20         sty     sreg
21         sty     sreg+1
22 .endif  
23
24 tosoreax:
25 .if (.cpu .bitand ::CPU_ISET_65SC02)
26         ora     (sp)
27         ldy     #1
28 .else
29         ldy     #0
30         ora     (sp),y          ; byte 0
31         iny
32 .endif        
33         sta     tmp1
34         txa
35         ora     (sp),y          ; byte 1
36         tax
37         iny
38         lda     sreg
39         ora     (sp),y          ; byte 2
40         sta     sreg
41         iny
42         lda     sreg+1
43         ora     (sp),y          ; byte 3
44         sta     sreg+1
45
46         lda     tmp1
47         jmp     addysp1
48