1;--------------------------------------------------------------------------
2;  ulong2fps16x16.S - convert signed long to fixed16x16
3;
4;  Copyright (C) 2004, Vangelis Rokas <vrokas AT otenet.gr>
5;
6;  This library is free software; you can redistribute it and/or modify it
7;  under the terms of the GNU General Public License as published by the
8;  Free Software Foundation; either version 2, or (at your option) any
9;  later version.
10;
11;  This library is distributed in the hope that it will be useful,
12;  but WITHOUT ANY WARRANTY; without even the implied warranty of
13;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;  GNU General Public License for more details.
15;
16;  You should have received a copy of the GNU General Public License
17;  along with this library; see the file COPYING. If not, write to the
18;  Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19;   MA 02110-1301, USA.
20;
21;  As a special exception, if you link this library with other files,
22;  some of which are compiled with SDCC, to produce an executable,
23;  this library does not by itself cause the resulting executable to
24;  be covered by the GNU General Public License. This exception does
25;  not however invalidate any other reasons why the executable file
26;  might be covered by the GNU General Public License.
27;--------------------------------------------------------------------------
28
29	radix dec
30
31;--------------------------------------------------------
32; public variables in this module
33;--------------------------------------------------------
34	global ___ulong2fps16x16
35
36;--------------------------------------------------------
37;	Equates to used internal registers
38;--------------------------------------------------------
39STATUS	equ	0xfd8
40WREG	equ	0xfe8
41FSR0L	equ	0xfe9
42FSR1L	equ	0xfe1
43FSR2L	equ	0xfd9
44POSTDEC1	equ	0xfe5
45PREINC1	equ	0xfe4
46PLUSW1	equ	0xfe3
47PRODL	equ	0xff3
48PRODH	equ	0xff4
49
50
51S_ulong2fps16x16____ulong2fps16x16	code
52___ulong2fps16x16:
53
54	movlw	0x02
55	movff	PLUSW1, FSR0L
56	movlw	0x01
57	movff	PLUSW1, PRODH
58
59	bcf	FSR0L, 7
60
61@1:
62	return
63
64	end
65