Since we do not have native C compilers on the Oric, this forum will be mostly be used by people using CC65 or the OSDK. But any general C related post will be welcome !
Yicker
Pilot Officer
Posts: 97 Joined: Thu Jan 26, 2006 11:27 pm
Location: St. Helens, Merseyside, UK
Post
by Yicker » Fri Oct 15, 2010 11:26 pm
Hi,
I need to convert a packed floating point number as stored by the Oric to it's original value.
For example
Code: Select all
118 would be stored as #87 #66 #00 #00 #00
Can anyone tell me how I can convert it back to it's original value of decimal 118 using C#
Cheers
Scott
JamesD
Flight Lieutenant
Posts: 358 Joined: Tue Nov 07, 2006 7:38 am
Post
by JamesD » Sat Oct 16, 2010 6:46 am
JamesD
Flight Lieutenant
Posts: 358 Joined: Tue Nov 07, 2006 7:38 am
Post
by JamesD » Sat Oct 16, 2010 7:30 am
JamesD
Flight Lieutenant
Posts: 358 Joined: Tue Nov 07, 2006 7:38 am
Post
by JamesD » Sat Oct 16, 2010 7:34 am
Look for other 8 bit computer 5 byte format floating point numbers.
It will be 4 bytes representing the number, 1 bit the sign, and 7 bits the exponent. At least if it is consistent with other machines.
Dbug
Site Admin
Posts: 4461 Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:
Post
by Dbug » Sat Oct 16, 2010 1:32 pm
Look at the C compiler source code:
http://miniserve.getmyip.com/svn/public ... rces/gen.c
The
void printfloat(double val) routine is charged to convert a double accuracy floating point value to a 5 byte format.
Doing the opposite is not much complex I guess