]> git.sur5r.net Git - cc65/blob - abs.s
5daa8a14acb8c355cc3b98e5fe19d4b46b77c21b
[cc65] / abs.s
1 ;
2 ; Ullrich von Bassewitz, 17.06.1998
3 ;
4 ; int abs (int x);
5 ;
6
7         .export         _abs
8         .import         negax
9
10 _abs:   cpx     #$00            ; test hi byte
11         bpl     L1
12         jmp     negax           ; Negate if negative
13 L1:     rts
14
15
16