* src/*.c, src/pic16/{gen.c,glue.c,main.c}: applied Vangelis
[fw/sdcc] / device / lib / pic16 / libsdcc / fixed16x16 / fps16x162schar.S
1
2 ;
3 ; fps16x162schar.S - convert fixed16x16 to signed char
4 ;
5 ; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
6 ;
7 ;
8 ; $Id$
9 ;
10
11         radix dec
12
13 ;--------------------------------------------------------
14 ; public variables in this module
15 ;--------------------------------------------------------
16         global ___fps16x162schar
17
18 ;--------------------------------------------------------
19 ;       Equates to used internal registers
20 ;--------------------------------------------------------
21 STATUS  equ     0xfd8
22 WREG    equ     0xfe8
23 FSR0L   equ     0xfe9
24 FSR1L   equ     0xfe1
25 FSR2L   equ     0xfd9
26 POSTDEC1        equ     0xfe5
27 PREINC1 equ     0xfe4
28 PLUSW1  equ     0xfe3
29 PRODL   equ     0xff3
30 PRODH   equ     0xff4
31
32
33 S_fps16x162schar____fps16x162schar      code
34 ___fps16x162schar:
35
36         movlw   0x04
37         movff   PLUSW1, PRODL
38
39         movlw   0x03
40         movf    PLUSW1, w
41
42         btfss   PRODL, 7
43         bra     @1
44         negf    WREG
45
46 @1:
47         return
48
49         end