Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Freyaday on June 04, 2011, 02:17:11 pm

Title: 32-bit math
Post by: Freyaday on June 04, 2011, 02:17:11 pm
I'm working on some 32-bit math routines, and here's what I've come up with so far.
High bytes: A,C,E
Low bytes: B,D,F
Code: (add) [Select]
.E is 1 if B is a signed 16-bit integer being converted into 32-bit
If E and (B<<0
-1->A
Else
0->A
End
.F is to E as D is to B
If F and (D<<0
-1->C
Else
0->C
End
B+D->F
If B>D and (F<B) or (B<=D and (F<D
A+1->A
End
A+C->E
Code: (comparison) [Select]
If Signed
B+e^(15)->E
If E<B
A+1->A
End
E->B
D+e^(15)->E
If E<D
C+1->C
End
E->D
0->E->F
.comp is the comparison being performed
If A comp C and (B comp D)
1->F
End
If Signed
B+e^(15)->E
If E<B
A-1->A
End
E->B
D+e^15->E
If E<D
C-1->C
End
E->D
End
0->E
End