CHAPTER 9. INSTRUCTION SET

9.4.3Arithmetic and Logic Instructions

ADDS A, #n4

Function: A A + n4; Skip if carry; n4 = I3 to I0 : 0 to FH

Binary adds 4-bit immediate data n4 to the contents of the A register and skips the next instruction if a carry is generated. The carry flag is not affected.

When combined with an ADDC A, @HL instruction, this instruction becomes a base correction instruction.

(See section 9.1.)

ADDS A, @HL

Function: A A + (HL); Skip if carry

Binary adds the data memory contents addressed by register pair HL to the contents of the A register and skips the next instruction if a carry is generated. The carry flag is not affected.

ADDC A, @HL

Function: A, CY A + (HL) + CY

Binary adds the data memory contents addressed by register pair HL to the contents of the A register, including the carry flag. If a carry is generated, the carry flag is set. If a carry is not generated, the carry flag is reset.

When an ADDS A, #n4 instruction is placed after this instruction, when a carry is generated at this instruction, the ADDS A, #n4 instruction is skipped. When a carry is not generated, the ADDS A, #n4 instruction is executed and the skip function of the ADDS A, #n4 instruction is disabled. Therefore, the combination of these instructions can be used in base correction (see section 9.1).

AND A, @HL

Function: A A (HL)

ANDs the contents of the A register and the data memory contents addressed by register pair HL and sets the result into the A register.

163

Page 174
Image 174
NEC PD75P402, PD75402A user manual Arithmetic and Logic Instructions, See section, 163