
Chapter 5
5.3.11 DECA – Decrement R and Place in Acc
Syntax
DECA R
Encoding
0 0001
10rr rrrr
Operation
R-1
→
A
Status Affected
Z
Description
Decrease the contents of data memory R by one. The result is placed in
the accumulator.
Example
The following codes illustrate how to make a 16-iteration loop
MOV A, @0x10
;
R10 = 0x10
MOV 0x10, A
LOOP:
DECA 0x10
;
Acc = R10 – 1
MOV 0x10, A
;
R10 = Acc
JBS 0x03, 2
;
check Z flag
JMP LOOP
…
5.3.12 DJZ – Decrement R (Skip if Result is Zero)
Syntax DJZ R
Encoding
0 0101
11rr rrrr
Operation
R-1
→
R, skip next instruction if the result is zero.
Status Affected
None
Description
Decrease the contents of data memory R by 1. The result is placed in R.
If the result is zero, the next instruction, which is already fetched, will be
discarded.
Example
The following codes illustrate how to make a 16-iteration loop
MOV A, @0x10
;
R10 = 0x10
MOV 0x10, A
LOOP:
…
DJZ 0x10
;
R10 = R10 – 1
JMP LOOP
;
if result! = 0, go to LOOP
…
EM60000 Series User’s Manual
Instruction Set
•
55
Содержание EM60000 series
Страница 8: ...Contents viii Contents EM60000 Series User s Manual ...
Страница 24: ...Chapter 2 16 Architecture EM60000 Series User s Manual ...
Страница 54: ...Chapter 4 46 Special Function Control EM60000Series User s Manual ...
Страница 80: ...Chapter 5 72 Instruction Set EM60000Series User s Manual ...