Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
DSP frac arithmetic help
Posted by: Laurent / Thadoss Feb,27.2015-15:03 

Hi,

Until now, I've always coded the DSP with integer arithmetic.

I'm trying to play with a fractional representation of numbers :

0 = 0 ;)
-1 = $800000
1 = $7fffff

0.5 = $3fffff
-0.5 = $400000


So I read the value -1 from x memory and I want to get its absolute value :

move x:value,x0 -----> x0=$800000

move x0,a -----------> A = $ff 800000 000000

abs a ---------------> A = $00 800000 000000


I would have expected A to be like $00 7fffff ffffff

What is wrong ?
How should I get the ABS value of -1 ?

Regads

Laurent











[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
DSP frac arithmetic help Laurent / Thadoss Feb,27.2015-15:03
  Re: DSP frac arithmetic help Laurent / Thadoss Feb,27.2015-15:08
  Re: DSP frac arithmetic help dml Feb,27.2015-15:28
    Re: DSP frac arithmetic help Laurent / Thadoss Feb,27.2015-18:32
      Re: DSP frac arithmetic help dml Feb,27.2015-18:42
        Re: DSP frac arithmetic help dml Feb,27.2015-18:46
          Re: DSP frac arithmetic help Splash/S1 Feb,27.2015-20:21
            Re: DSP frac arithmetic help dml Feb,27.2015-20:38
              Re: DSP frac arithmetic help Laurent / Thadoss Feb,27.2015-20:42
    Re: DSP frac arithmetic help mikro Feb,28.2015-10:44
      Re: DSP frac arithmetic help dml Feb,28.2015-12:35


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

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.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson