0
|
1 ;=============================================================================
|
|
2 ;
|
628
|
3 ; File math.inc combined next generation V3.04.3
|
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
|
628
|
21 extern addU16 ; sub_c:2 = sub_a:2 + sub_b:2 with USIGNED values
|
|
22 ; trashes WREG
|
|
23
|
604
|
24 extern sub16 ; sub_c:2 = sub_a:2 - sub_b:2 with SIGNED values
|
|
25 ; sets neg_flag if result is < 0
|
|
26 ; trashes WREG
|
|
27
|
|
28 extern subU16 ; sub_c:2 = sub_a:2 - sub_b:2 with UNSIGNED values
|
|
29 ; sets neg_flag if result is < 0
|
|
30 ; trashes WREG
|
|
31
|
628
|
32 extern cmpU16 ; trashed = sub_a:2 - sub_b:2 with UNSIGNED values
|
623
|
33 ; sets neg_flag if result is < 0, but does not store result itself
|
|
34 ; trashes WREG
|
|
35
|
604
|
36 extern mult16x16 ; xC:4 = xA:2 * xB:2 with UNSIGNED values
|
|
37 ; trashes PRODL, PRODH, WREG
|
|
38
|
|
39 extern div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder
|
|
40 ; trashes xB, WREG
|
|
41
|
|
42 extern div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
|
|
43 ; trashes WREG
|
|
44
|
|
45 extern isr_shift_C31 ; 24 bit shift, repeated WREG times,
|
|
46 ; dedicated to a specific usage
|
|
47
|
|
48 extern isr_unsigned_mult16x16 ; isr_xC = isr_xA * _isr_xB with UNSIGNED values
|
|
49 ; trashes PRODL, PRODH, WREG
|
|
50
|
|
51 extern isr_signed_mult16x16 ; isr_xC = isr_xA * _isr_xB with SIGNED values
|
|
52 ; trashes PRODL, PRODH, WREG
|