84
CHAPTER 5 EXPLANATION OF INSTRUCTIONS
User's Manual U12326EJ4V0UM
Decimal Adjust Register for Subtraction
ADJBS Decimal Adjustment of Subtraction Result
[Instruction format] ADJBS
[Operation] Decimal Adjust Accumulator for Subtraction
[Operand]
None
[Flag]
ZACCY
×××
[Description]
The A register, CY flag and AC flag are decimally adjusted from their contents. This instruction carries out
an operation having meaning only when the BCD (binary coded decimal) data is subtracted and the
subtraction result is stored in the A register (in all other cases, the instruction carries out an operation having
no meaning).
See the table below for the adjustment method.
If the adjustment result shows that the A register contents are 0, the Z flag is set (1). In all other cases,
the Z flag is cleared (0).
Condition Operation
AC = 0 CY = 0 AA, CY 0, AC 0
CY = 1 A A–01100000B, CY 1, AC0
AC = 1 CY = 0 AA–00000110B, CY 0, AC 0
CY = 1 A A–01100110B, CY 1, AC0