Specifications
148
3706C–MICRO–2/11
AT89LP3240/6440
22.1.3 CJNE A, @R
i
, rel
Function: Compare and Jump if Not Equal
Description: CJNE compares the magnitudes of the Accumulator and indirect RAM location and branches if their values are
not equal. The branch destination is computed by adding the signed relative-displacement in the last instruction
byte to the PC, after incrementing the PC to the start of the next instru ction. The carry flag is set if the
unsigned
integer value of ACC is less than the unsigned integer value of the indirect location; otherwise, the carry is
cleared. Neither operand is affected.
Example: The Accumulator contains 34H. Register 0 contains 78H and 78H contains 56H. The first instruction in the
sequence,
CJNE A, @R0, NOT_EQ
; . . . . . . ...... ...... ; ACC = @R0.
NOT_EQ:
JC REQ_LOW .. ;IF ACC< @R0.
; . . . . . . ...... ...... ;ACC > @R0.
sets the carry flag and branches to the instr
uction at label NOT_EQ. By testing the carry flag, the second
instruction determines whether ACC is greater or less than the location pointed to by R0.
Bytes: 2
Cycles: 9
Encoding: A5 1011011 i rel. address
Operation: CJNE
(PC) ← (PC) + 3
IF (A) ≠ ((R
i
))
THEN
(PC) ← (PC) + relative offset
IF (A) < ((R
i
))
THEN
(C) ← 1
ELSE
(C) ← 0
22.1.4 CLR M
Function: Clear MAC Accumulator
Description: CLR M clears the 40-bit M register. No flags are affected.
Example: The M registercontains 123456789AH. The following instruction,
CLR M
leaves the M register set to 0000000000H.
Bytes: 2
Cycles: 2
Encoding: A5 11100100
Operation: JMP
(M) ← 0