|
Atari coding BBS
Re: 5 instr mapper |
Posted by: mikro
|
Sep,12.2016-05:18
|
Actually, for the old times sake, I did write it down (you should always do that!):
16.0 - 0.5 = 15.5, right? So, in 8.8 fixed point:
16.0 * 256 = $1000
0.5 * 256 = $0080
Cool. Since we have trouble with negative values, let's neg the adder:
-0.5 * 256 = $ff80
I guess now you see where I'm heading:
$10:$00
+ $ff:$80
-------
$0f:80
$0f80 / 256 = 15.5
You see, the important thing is not to 'cut' the sign from the number, you can't work separately with the integer and fraction parts.
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|