Mercurial > public > hwos_code
comparison src/math.inc @ 631:185ba2f91f59
3.09 beta 1 release
author | heinrichsweikamp |
---|---|
date | Fri, 28 Feb 2020 15:45:07 +0100 |
parents | cd58f7fc86db |
children | 4050675965ea |
comparison
equal
deleted
inserted
replaced
630:4cd81bdbf15c | 631:185ba2f91f59 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File math.inc combined next generation V3.04.3 | 3 ; File math.inc combined next generation V3.08.8 |
4 ; | 4 ; |
5 ; | 5 ; |
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
7 ;============================================================================= | 7 ;============================================================================= |
8 ; HISTORY | 8 ; HISTORY |
9 ; 2011-08-03 : [mH] moving from OSTC code | 9 ; 2011-08-03 : [mH] moving from OSTC code |
10 | 10 |
11 extern convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo) | 11 extern convert_time ; convert minutes in hi:lo to hours (up:hi) and minutes (lo) |
12 ; also usable for conversion of seconds to minutes and seconds | 12 ; also usable for conversion of seconds to minutes and seconds |
13 ; trashes xA, xB, xC | 13 ; trashes xA, xB, xC |
14 | 14 |
15 extern div16 ; divA:2 = divA:2 / 2^WREG | 15 extern div16 ; divA:2 = divA:2 / 2^WREG SHIFT-RIGHT with UNSIGNED values |
16 ; trashes WREG | 16 ; trashes WREG |
17 | 17 |
18 extern mult16 ; divA:2 = divA:2 * 2^WREG | 18 extern mult16 ; divA:2 = divA:2 * 2^WREG SHIFT-LEFT with UNSIGNED values |
19 ; trashes WREG | 19 ; trashes WREG |
20 | 20 |
21 extern addU16 ; sub_c:2 = sub_a:2 + sub_b:2 with USIGNED values | 21 extern addU16 ; sub_c:2 = sub_a:2 + sub_b:2 ADDITION with UNSIGNED values |
22 ; trashes WREG | 22 ; trashes WREG |
23 | 23 |
24 extern sub16 ; sub_c:2 = sub_a:2 - sub_b:2 with SIGNED values | 24 extern sub16 ; sub_c:2 = sub_a:2 - sub_b:2 SUBTRACTION with SIGNED values |
25 ; sets neg_flag if result is < 0 | 25 ; sets neg_flag if result is < 0 |
26 ; trashes WREG | 26 ; trashes WREG |
27 | 27 |
28 extern subU16 ; sub_c:2 = sub_a:2 - sub_b:2 with UNSIGNED values | 28 extern subU16 ; sub_c:2 = sub_a:2 - sub_b:2 SUBTRACTION with UNSIGNED values |
29 ; sets neg_flag if result is < 0 | 29 ; sets neg_flag if result is < 0 |
30 ; trashes WREG | 30 ; trashes WREG |
31 | 31 |
32 extern cmpU16 ; trashed = sub_a:2 - sub_b:2 with UNSIGNED values | 32 extern cmpU16 ; trashed = sub_a:2 - sub_b:2 COMPARE with UNSIGNED values |
33 ; sets neg_flag if result is < 0, but does not store result itself | 33 ; sets neg_flag if result is < 0, but does not store result itself |
34 ; trashes WREG | 34 ; trashes WREG |
35 | 35 |
36 extern mult16x16 ; xC:4 = xA:2 * xB:2 with UNSIGNED values | 36 extern mult16x16 ; xC:4 = xA:2 * xB:2 MULTIPLICATION with UNSIGNED values |
37 ; trashes PRODL, PRODH, WREG | 37 ; trashes PRODL, PRODH, WREG |
38 | 38 |
39 extern div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder | 39 extern div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder DIVISION with UNSIGNED values |
40 ; trashes xB, WREG | 40 ; trashes xB, WREG |
41 | 41 |
42 extern div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder | 42 extern div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder DIVISION with UNSIGNED values |
43 ; trashes WREG | 43 ; trashes WREG |
44 | 44 |
45 extern isr_shift_C31 ; 24 bit shift, repeated WREG times, | 45 extern isr_shift_C31 ; 24 bit shift, repeated WREG times, dedicated to a specific usage |
46 ; dedicated to a specific usage | |
47 | 46 |
48 extern isr_unsigned_mult16x16 ; isr_xC = isr_xA * _isr_xB with UNSIGNED values | 47 |
48 extern isr_unsigned_mult16x16 ; isr_xC = isr_xA * isr_xB MULTIPLICATION with UNSIGNED values ** for ISR only ** | |
49 ; trashes PRODL, PRODH, WREG | 49 ; trashes PRODL, PRODH, WREG |
50 | 50 |
51 extern isr_signed_mult16x16 ; isr_xC = isr_xA * _isr_xB with SIGNED values | 51 extern isr_signed_mult16x16 ; isr_xC = isr_xA * isr_xB MULTIPLICATION with SIGNED values ** for ISR only ** |
52 ; trashes PRODL, PRODH, WREG | 52 ; trashes PRODL, PRODH, WREG |