]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lbneg.s
9d3bb13b590960504ad346fd3b9d7cd9ee5d3e9e
[cc65] / libsrc / runtime / lbneg.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ;
4 ; CC65 runtime: boolean negation for longs
5 ;
6
7         .export         bnegeax
8         .import         return0, return1
9         .importzp       sreg, tmp1
10
11 bnegeax:
12         stx     tmp1
13         ldx     #0              ; High byte of result
14         ora     tmp1
15         ora     sreg
16         ora     sreg+1
17         bne     @L0
18         lda     #1
19         rts
20
21 @L0:    txa                     ; X is zero
22         rts
23