Imported Upstream version 2.9.0
[debian/cc1111] / device / lib / pic16 / libsdcc / fixed16x16 / fps16x162sint.S
1
2 ;
3 ; fps16x162sint.S - convert fixed16x16 to signed char
4 ;
5 ; written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
6 ;
7 ;
8 ; $Id: fps16x162sint.S 3838 2005-08-10 10:53:34Z tecodev $
9 ;
10
11         radix dec
12
13 ;--------------------------------------------------------
14 ; public variables in this module
15 ;--------------------------------------------------------
16         global ___fps16x162sint
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 PLUSW2  equ     0xfdb
29 PLUSW1  equ     0xfe3
30 PRODL   equ     0xff3
31 PRODH   equ     0xff4
32
33
34 S_fps16x162sint____fps16x162sint        code
35 ___fps16x162sint:
36
37         movlw   0x04
38         movff   PLUSW1, PRODL
39
40         movlw   0x03
41         movf    PLUSW1, w
42
43         btfss   PRODL, 7
44         bra     @1
45
46         bcf     PRODL, 7
47
48         comf    WREG, f
49         comf    PRODL, f
50         infsnz  WREG, f
51         incf    PRODL, f
52
53 @1:
54         return
55
56         end