DAC
Detailed Description
The contents of the accumulator are decremented by one. The carry bit is set if there is no borrow out of the high-order bit position, and reset if there is a borrow.
Note
Subtracting a number is carried out using the complement of the number and adding. Therefore subtracting 1 becomes adding -1.
The opcode for this instruction does not contain any additional data:
Examples
Example 1
If the accumulator contains 9, then the DAC operation will be as follows:
Accumulator = 1 0 0 1
+ (-1) 1 1 1 1
---------
Result 1 1 0 0 0
Carry (indicating no borrow)
Example 2
If the accumulator contains 0, then the DAC operation will be as follows:
Accumulator = 0 0 0 0
+ (-1) 1 1 1 1
---------
Result 0 1 1 1 1
Carry (indicating a borrow)