Original Post
🔒 Locked
float to byte array?
Advertisement
What would you like in those bytes?
The x86 op code fbstp will convert a floating point type into an array of packed BCDs.
Edited by - Magmai Kai Holmlor on December 30, 2001 5:03:11 AM
The x86 op code fbstp will convert a floating point type into an array of packed BCDs.
Edited by - Magmai Kai Holmlor on December 30, 2001 5:03:11 AM
Example 1:
Whatever you set F to, I shares the same memory, so you can treat it like an integer. You could also do "unsigned char B[4];" instead of the integer (remember that x86 CPU''s are little endian). Example 2:
I now equals the data within F. There are more methods, but they aren''t as good as those two.
[Resist Windows XP''s Invasive Production Activation Technology!]
|
Whatever you set F to, I shares the same memory, so you can treat it like an integer. You could also do "unsigned char B[4];" instead of the integer (remember that x86 CPU''s are little endian). Example 2:
|
I now equals the data within F. There are more methods, but they aren''t as good as those two.
[Resist Windows XP''s Invasive Production Activation Technology!]
what are you trying to do this for? you can do this without asm. just look up the IEEE spec for floats and doubles. its just a matter of following the spec. you can use arrays.
example PSEUDO code:
just remeber floating point numbers have a format to follow. so make sure you look it up. it owuld be best to explain what you need this for.
you can do the same with doubles
Edited by - a person on December 30, 2001 6:20:16 PM
example PSEUDO code:
|
just remeber floating point numbers have a format to follow. so make sure you look it up. it owuld be best to explain what you need this for.
you can do the same with doubles
Edited by - a person on December 30, 2001 6:20:16 PM
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement