tags:

views:

44

answers:

1

if I want to store 10.125 how is it done?

I have this:

        ORG     $1000
  DN    DC.L    10.125
        END     $400

and in the debug it is stored as:

00001000= 0000000A

That doesnt seem to be getting the fraction part in there. This is assembly 68k.

+1  A: 

A 68k doesn't have a floating point unit, does it? You can store the value as fixed-point. In binary, your number would be 1010.001, so you need to reserve at least three bits for the fractional part, and you'll be good. You can then use 0x51 (1010001b) to represent 10.125d in your program.

Carl Norum