SX
Microcontroller
Basic
Math
Method
s
Use the
expression evaluator
to translate a mathematical formula from infix to postfix and then into actual code
November 2003 MassMind newsletter
- 32 Bit math routines
Add
Subtract
Increment / Decrement
General Purpose
from Dmitry Kiryashov
Best
16 bit
from
Scott Dattalo
32 bit and detect zero
from Dmitry Kiryashov, Rich Leggitt,
Andrew Warren
, and
Scott Dattalo
Two's complement / Negate
32 bit
(unknown author, please step forward)
8 bit
from
Andy Warren
Multiply
Divide
Reciprocal
32768 / x by
Nikolai Golovchenko
Scale
8 bit to a percentage
from
Scott Dattalo
with optional precision increase from
Nikolai Golovchenko
8 bit to a percentage fast
from Jason Harper
8 bit to a percentage accurate
from Dmitry Kiryashov
Square
Square Root
see also:
Scenix math pack (
source
,
notes
),
sin&fft
(
source
, notes)
Vector Magnatude
by
Nikolai Golovchenko
PIC Math Routines: (use the
PIC
MPASM source to
SX
SASM
Source Converter
by
Nikolai Golovchenko
)
http://www.markworld.com/microtools.html
excellent math (Generate 8 or 16 bit PIC code to evaluate an infix expression. Analyze an IEEE floating point number) and servos
http://www.microchip.com
Math Library
Application Notes
AN575
Floating Point and
AN617
Fixed Point
http://ndsl226.dnvr.uswest.net/cgi-bin/tl.exe/AERC/Poscalc/math1h.asm
64-bit floating point library
http://ndsl226.dnvr.uswest.net/cgi-bin/tl.exe/AERC/Poscalc/
SIN, COS, SQRT, etc., routines
http://www.ken.webster.org/projects/poscalc/
Questions:
http://www.silab.it/frox/stamp/bs2_math.htm
BCD math for the BASIC stamp. Compile to SX code with SX/B?