| Other BBSes » |
Atari coding BBS
|Re: 5 instr mapper|
Posted by: dml
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]