NEC 78K/0 Series User Manual page 83

Nec computer hardware user's manual
Hide thumbs Also See for 78K/0 Series:
Table of Contents

Advertisement

ADJBA
[Instruction format]
[Operation]
[Operand]
None
[Flag]
Z
AC
×
×
[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 added and the addition 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
≤ 9
A
to A
A
3
0
AC = 0
A
≥ 10
A
to A
A
3
0
AC = 0
A
AC = 1
A
A
CHAPTER 5 EXPLANATION OF INSTRUCTIONS
ADJBA
Decimal Adjust Accumulator for Addition
CY
×
≤ 9 and CY = 0
to A
7
4
≥ 10 or CY = 1
to A
7
4
to A
< 9 and CY = 0
7
4
≥ 9 or CY = 1
to A
7
4
≤ 9 and CY = 0
to A
7
4
≥ 10 or CY = 1
to A
7
4
User's Manual U12326EJ4V0UM
Decimal Adjust Register for Addition
Decimal Adjustment of Addition Result
Operation
A ← A, CY ← 0, AC ← 0
A ← A+01100000B, CY ← 1, AC ← 0
A ← A+00000110B, CY ← 0, AC ← 1
A ← A+01100110B, CY ← 1, AC ← 1
A ← A+00000110B, CY ← 0, AC ← 0
A ← A+01100110B, CY ← 1, AC ← 0
83

Advertisement

Table of Contents
loading

Table of Contents