How can one keep a running sum of many two-byte signed integers?
The path taken thus far has been to determine if the first signed integer is negative. If so, it is placed in the lower two bytes of the total and the upper three bytes of the total are filled with 0xFF FF FF. If found to be positive it is just placed in the lower two bytes.
From that point on, the lower bytes are added. If the Vflag is clear, nothing is done. Where I get into trouble is when the Vflag is set (when I must modify the next higher byte(s)).
Is there a way to properly handle handle the overflow based on the other S-register flags?
Moderator: If this is not the proper forum for this message, please transfer it.