ascii converter
ascii converter
(OP)
Hello,
I want to get a formula for basic so I can convert a Integer
word with 2 ascii sign to split them in a MSD and LSD.
Example:
I have received from a database PC a Integer word N7:0 = 8525.
These word have 2 ASCII words: MSD=! and LSD=M.
How is the formula for basic (1771-db) so that I can
split this integer word(8525) in MSD=33 (ascii=!) and
LSD=77 (ascii=M)?
Any ideas?
Greetings,
mulderm
I want to get a formula for basic so I can convert a Integer
word with 2 ascii sign to split them in a MSD and LSD.
Example:
I have received from a database PC a Integer word N7:0 = 8525.
These word have 2 ASCII words: MSD=! and LSD=M.
How is the formula for basic (1771-db) so that I can
split this integer word(8525) in MSD=33 (ascii=!) and
LSD=77 (ascii=M)?
Any ideas?
Greetings,
mulderm





RE: ascii converter
First divide 8525 into 256 (value of one byte) this will give you 33 i.e. ascii for "!". Then find out what the rest is by doing 8525 MOD 256 (it will give you the remainder) and get the result 77, which is ascii for "M".
The MOD function is sometimes found under the // symbol and then some. FORTH, for instance, uses /MOD for that function. You can, of course, also do 8525 - 33*256, which will do exactly the same thing.
RE: ascii converter
characters. If print, then it won't work-- it may translate into a control code, a non-printing character etc.
Each language processes ASCII text differently -- you must
know what you are doing.
<nbucska@pcperipherals.com>