Propeller Manual

Table Of Contents
3: Assembly Language Reference – ADDX
Propeller Manual v1.1 · Page 265
After executing the above, the double-long (64-bit) result is in the long registers
XHigh:XLow. If XHigh:XLow started out as $0000_0000:FFFF_FFFF (4,294,967,295) and
YHigh:YLow was $0000_0000:0000_0001 (1) the result in XHigh:XLow would be
$0000_0001:0000_0000 (4,294,967,296). This is demonstrated below.
Hexadecimal Decimal
(high) (low)
(XHigh:XLow) $0000_0000:FFFF_FFFF 4,294,967,295
+ (YHigh:YLow) + $0000_0000:0000_0001 + 1
---------------------- ---------------
= $0000_0001:0000_0000 = 4,294,967,296
Of course, it may be necessary to specify the WC and WZ effects on the final instruction, ADDX,
in order to watch for a result of zero or an unsigned overflow condition.
For
ADDX, if the WZ effect is specified, the Z flag is set (1) if Z was previously set and Value1 +
Value2 + C equals zero (use
WC and WZ on preceding ADD and ADDX instructions). If the WC
effect is specified, the C flag is set (1) if the summation resulted in an unsigned carry (32-bit
overflow). The result is written to Value1 unless the
NR effect is specified.