
Chapter 5
5.3.23 JZA – Increment R and Place in Acc (Skip if result is zero)
Syntax JZA R
Encoding
0 0111
11rr rrrr
Operation
R+1
→
A, skip next instruction if result is zero
Status Affected
None
Description
Increase the contents of data memory R. The result is placed in the
accumulator. If the result is 0, the next instruction, which is already
fetched, is discarded.
Example
The following codes illustrate how to make a 256-iteration loop
MOV A, @0
;
Acc = 0
LOOP: MOV 0x10, A
;
R10 = Acc
…
JZA 0x10
;
Acc = R10 + 1
JMP LOOP
;
if result!=0, go to LOOP
…
5.3.24 MOV – Move Data
Syntax MOV R, A
Encoding
0 0000
01rr rrrr
Operation
A
→
R
Status Affected
None
Description
Move the contents of the accumulator to data memory R.
Example
MOV 0x01, A
;
move Acc to TCC (R1)
MOV 0x10, A
;
move Acc to R10
Syntax MOV R, R
Encoding
0 0100
01rr rrrr
Operation
R
→
R
Status Affected
Z
Description
Move the contents of data memory to itself. If the content is zero, Z flag
in Status register is set; else, Z flag will be cleared.
Example
MOV 0x10, 0x10
;
move R10 to itself
JBS 0x03, 2
;
check zero flag of R3 (status register)
JMP R10_NOT_ZERO
;
if Z!=1, go to R10_NOT_ZERO
…
;
Z=1, means R10 = 0
60
•
Instruction Set
EM60000Series User’s Manual