Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ff3:ff3us:doc:snes:opcode [2017/04/12 21:16] hatzen08 [BIT] |
ff3:ff3us:doc:snes:opcode [2022/09/21 18:38] strotlog undo incorrect changes to c flag: c=1 carries in a 1 in adds; c=1 is set by overflowing |
||
---|---|---|---|
Line 116: | Line 116: | ||
Add or subtract the value in the A or C register with the value in the designed memory address. ADC will add the value and SBC will subtract the value. | Add or subtract the value in the A or C register with the value in the designed memory address. ADC will add the value and SBC will subtract the value. | ||
- | When the carry flag is unset, a value of one will be added in the addition or subtraction operation. | + | When the carry flag is set, a value of one will be added in the addition or subtraction operation. |
The operation can overflow or underflow. It is the coder responsibility to check these cases and adjust the resulting value. A common method is to check the carry flag for overflow or underflow and cap the value to a prefixed setting. | The operation can overflow or underflow. It is the coder responsibility to check these cases and adjust the resulting value. A common method is to check the carry flag for overflow or underflow and cap the value to a prefixed setting. | ||
Line 289: | Line 289: | ||
| | | | ||
| | | | ||
- | | | + | | |
^ Opcode | ^ Opcode |