Mac Number conversion (LSB/MSB)
Quote from Forum Archives on December 8, 1997, 12:40 amPosted by: mel <mel@...>
Heres one for the thinkers...I need a couple of functions (my brains in a
fog lately...).I am reading a file which has binary numbers stored in LSB/MSB format so
some bytes read in will look like this :73 0 0 0 27 01 0 0
Those are basically TWO longs. The first is 73 0 0 0 (LSB->MSB) and then 27
01 0 0 is the second one. If memory serves right, the Mac stores in MSB/LSB.I just bet someone has a real fast efficient way of turing those digits
around (they are in binary in the file). If I was still in Z80, I'd do a
rotate thru the carry. I'm not.But I have a lot of processing to do with longs and words stored in this
format.Suggestions?
Mel Patrick - theWabbitGuy - mel@intergate.bc.ca
www.intergate.bc.ca/business/mel
Posted by: mel <mel@...>
fog lately...).
I am reading a file which has binary numbers stored in LSB/MSB format so
some bytes read in will look like this :
73 0 0 0 27 01 0 0
Those are basically TWO longs. The first is 73 0 0 0 (LSB->MSB) and then 27
01 0 0 is the second one. If memory serves right, the Mac stores in MSB/LSB.
I just bet someone has a real fast efficient way of turing those digits
around (they are in binary in the file). If I was still in Z80, I'd do a
rotate thru the carry. I'm not.
But I have a lot of processing to do with longs and words stored in this
format.
Suggestions?
Mel Patrick - theWabbitGuy - mel@intergate.bc.ca
http://www.intergate.bc.ca/business/mel