Search site Dead Hackers Society
Other BBSes »

Outline 2019

Sommarhack 2019
Demoscene   º   Coding   º   CT60   º   Buy/sell   º   Misc/crap   º   Alive magazine   º   SNDH/Tracking

Atari coding BBS
Re: 5 instr mapper
Posted by: dml Sep,12.2016-11:41 

Another way to think about it...

The signs during an addition do not matter. e.g. you can imagine an addition using the unsigned interpretation of the terms and you get the same outcome.

e.g. -1s == 255u

When you add the 'signed' numbers (with overflow) its like adding unsigned numbers such that the unsigned result wraps to exactly what you expect for a signed add.


0 + -1 = -1
0 + 255 = 255

127 + -1 = 126
127 + 255 = (382 & $FF) = 126

So all you really need is unsigned sources, carry, and binary modulo (usually accomplished with MOVE or AND or natural clipping of the register). This is how many of the texture mappers can be seen to magically work with signed sources - its equivalent to using very big unsigned increments.

This still screws up if the module is not properly maintained e.g. the MSB carry starts overflowing into other fields. Then you get problems.

Anyway it may be easier to think about it this way than trying to make sense of what happens to the carry, sign and extends in addx/add-carry patterns. Put signed values in, and think of them as big unsigned numbers from there onwards.


[All messages in this thread]

Topic Posted by  Date 
5 instr mapper MKM/Lamers Sep,09.2016-21:40
  Re: 5 instr mapper mikro Sep,12.2016-04:41
  Re: 5 instr mapper mikro Sep,12.2016-05:18
    Re: 5 instr mapper MKM/Lamers Sep,12.2016-08:48
      Re: 5 instr mapper dml Sep,12.2016-11:41
        Re: 5 instr mapper MKM/Lamers Sep,12.2016-13:08
          DSP coding dml Sep,12.2016-23:55
            Re: DSP coding mikro Sep,13.2016-00:44
              Re: DSP coding MKM/Lamers Sep,13.2016-09:19

Reply to this message
Human verification (enter the text of the ASCII-art below):

   _   _   _   _  _  _        _  
 _|_ _|_ _|_ _|_ (_)  ) |_|_ / \ 
  |   |   |   |  (_) /_   |  \_/

© 1994-2019 Dead Hackers Society Contact: Anders Eriksson