Author Topic: 32-bit math  (Read 2409 times)

0 Members and 1 Guest are viewing this topic.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
32-bit math
« 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
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!