annotate src/math.inc @ 621:1ad0531e9078

3.01 release
author heinrichsweikamp
date Sat, 23 Feb 2019 16:51:14 +0100
parents ca4556fb60b9
children c40025d8e750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
3 ; File math.inc REFACTORED VERSION V2.99d
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ;
heinrichsweikamp
parents:
diff changeset
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
7 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
8 ; HISTORY
heinrichsweikamp
parents:
diff changeset
9 ; 2011-08-03 : [mH] moving from OSTC code
heinrichsweikamp
parents:
diff changeset
10
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
11 extern convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
12 ; also usable for conversion of seconds to minutes and seconds
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
13 ; trashes xA, xB, xC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
15 extern div16 ; divA:2 = divA:2 / 2^WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
16 ; trashes WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
18 extern mult16 ; divA:2 = divA:2 * 2^WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
19 ; trashes WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
20
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
21 extern sub16 ; sub_c:2 = sub_a:2 - sub_b:2 with SIGNED values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
22 ; sets neg_flag if result is < 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
23 ; trashes WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
24
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
25 extern subU16 ; sub_c:2 = sub_a:2 - sub_b:2 with UNSIGNED values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
26 ; sets neg_flag if result is < 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
27 ; trashes WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
28
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
29 extern mult16x16 ; xC:4 = xA:2 * xB:2 with UNSIGNED values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
30 ; trashes PRODL, PRODH, WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
31
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
32 extern div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
33 ; trashes xB, WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
34
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
35 extern div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
36 ; trashes WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
37
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
38 extern isr_shift_C31 ; 24 bit shift, repeated WREG times,
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
39 ; dedicated to a specific usage
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
40
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
41 extern isr_unsigned_mult16x16 ; isr_xC = isr_xA * _isr_xB with UNSIGNED values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
42 ; trashes PRODL, PRODH, WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
43
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
44 extern isr_signed_mult16x16 ; isr_xC = isr_xA * _isr_xB with SIGNED values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 0
diff changeset
45 ; trashes PRODL, PRODH, WREG