0
|
1 ;=============================================================================
|
|
2 ;
|
623
|
3 ; File math.inc combined next generation V3.03.2
|
0
|
4 ;
|
|
5 ;
|
|
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
|
|
7 ;=============================================================================
|
|
8 ; HISTORY
|
|
9 ; 2011-08-03 : [mH] moving from OSTC code
|
|
10
|
623
|
11 extern convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
|
604
|
12 ; also usable for conversion of seconds to minutes and seconds
|
|
13 ; trashes xA, xB, xC
|
|
14
|
|
15 extern div16 ; divA:2 = divA:2 / 2^WREG
|
|
16 ; trashes WREG
|
|
17
|
|
18 extern mult16 ; divA:2 = divA:2 * 2^WREG
|
|
19 ; trashes WREG
|
|
20
|
|
21 extern sub16 ; sub_c:2 = sub_a:2 - sub_b:2 with SIGNED values
|
|
22 ; sets neg_flag if result is < 0
|
|
23 ; trashes WREG
|
|
24
|
|
25 extern subU16 ; sub_c:2 = sub_a:2 - sub_b:2 with UNSIGNED values
|
|
26 ; sets neg_flag if result is < 0
|
|
27 ; trashes WREG
|
|
28
|
623
|
29 extern cmpU16 ; sub_a:2 - sub_b:2 with UNSIGNED values
|
|
30 ; sets neg_flag if result is < 0, but does not store result itself
|
|
31 ; trashes WREG
|
|
32
|
604
|
33 extern mult16x16 ; xC:4 = xA:2 * xB:2 with UNSIGNED values
|
|
34 ; trashes PRODL, PRODH, WREG
|
|
35
|
|
36 extern div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder
|
|
37 ; trashes xB, WREG
|
|
38
|
|
39 extern div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
|
|
40 ; trashes WREG
|
|
41
|
|
42 extern isr_shift_C31 ; 24 bit shift, repeated WREG times,
|
|
43 ; dedicated to a specific usage
|
|
44
|
|
45 extern isr_unsigned_mult16x16 ; isr_xC = isr_xA * _isr_xB with UNSIGNED values
|
|
46 ; trashes PRODL, PRODH, WREG
|
|
47
|
|
48 extern isr_signed_mult16x16 ; isr_xC = isr_xA * _isr_xB with SIGNED values
|
|
49 ; trashes PRODL, PRODH, WREG
|