SX
Microcontroller
Radix
Math
Method
s
ASCII
1 digit Hex to Binary 4 bits
From Regulus Berdin, Tracy Smith
2 digit Hex to Binary 8 bits
from Andrew Warren
2 digit Decimal to Binary 8 bits
from
Scott Dattalo
and Dmitry Kiryashov
BCD
unpacked to binary 2 digit to 8 bit
from Mike Keitz
packed to binary 2 digit to 8 bit
from
Scott Dattalo
half-packed to ASCII decimal 3 digit to 8 bit
from
Scott Dattalo
Binary
8bit to BCD half-packed (3 digits)
from
Scott Dattalo
16bit to BCD unpacked 5 digit 50 inst, ~200 executed 5 output registers
from John Payson
32bit to BCD packed and ASCII 10 digits
from
Ron Kreymborg
and Mike Keitz
16bit to ASCII 5 digits in 1 temp register, 76 instructions, ~500 executed
by James Newton (
Parallax menomics
see
Macros for using Parallax instructions with MPASM
also
Prlx.asm
)
16bit to ASCII 5 digits in 0 temp registers, 42 instructions, ~266 executed
by Rich Leggit tweeked by
Scott Dattalo
.and bugfix by Dmitry Kiryashov and
Nikolai Golovchenko
16bit to ASCII 5 digits in 0 temp registers, 68 instructions, ~220 executed
by
Nikolai Golovchenko
24bit signed to ASCII 8/9 digit decimal with point and minus sign (if negative)
by Tony Kübek
See also:
http://www.shm.monash.edu.au/~r.kreymborg/pic/dopic.cgix?ascii16
16 or 32 bit binary to ASCII
Questions:
fairiza@hotmail
asks: "
can you give me c++ program to convert ascii to binary & numeric to binary?"
See:
PICList post 1997/05/26/214501a
'...contains routines for extracting numbers ...'
PICList post /2000/12/06/132252a
'Hex to BCD in C'
PICList post /2000/12/06/111649a
'This program written in CC5X should give you a good idea how to do this. The program displays a 16 bit integer as a 5 digit decimal value, the number of digits can easily be changed'
PICList post 2000/12/06/141757a
It takes a signed 16 bit integer and outputs the representative ASCII characters...'