|
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.
e.g.
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] [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.
|