]> git.sur5r.net Git - cc65/blob - libsrc/runtime/lneg.s
Adjusted C declarations to the changed static driver names.
[cc65] / libsrc / runtime / lneg.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ;
4 ; CC65 runtime: negation on longs
5 ;
6
7 ;
8 ; eax = -eax
9 ;
10         .export         negeax
11         .importzp       sreg
12
13 negeax: clc
14         eor     #$FF
15         adc     #1
16         pha
17         txa
18         eor     #$FF
19         adc     #0
20         tax
21         lda     sreg
22         eor     #$FF
23         adc     #0
24         sta     sreg
25         lda     sreg+1
26         eor     #$FF
27         adc     #0
28         sta     sreg+1
29         pla
30         rts
31