
Chapter 5
5.3.6 CLR – Clear Register
Syntax CLR R
Encoding
0 0000
11rr rrrr
Operation
0
→
R
Status Affected
1
→
Z
Description
Clear contents of data memory R.
Example
CLR 0x01
;
clear TCC counter
CLR 0x0C
;
port 2 goes low
5.3.7 COM – Complement R
Syntax COM R
Encoding
0 0100
11rr rrrr
Operation
~R
→
R
Status Affected
Z
Description
The contents of data memory R are complemented. The result is placed in
R.
Example
MOV A, @0x55
;
R10 = 0x55
MOV 0x10, A
COM 0x10
;
R10 = 0xAA
COM 0x0C
;
toggle port 2
5.3.8 COMA – Complement R and Place in Acc
EM60000 Series User’s Manual
Instruction Set
•
53
Syntax COMA R
Encoding
0 0100
10rr rrrr
Operation
~R
→
A
Status Affected
Z
Description
The contents of data memory R are complemented. The result is placed
in the accumulator.
Example
MOV A, @0x55
;
R10 = 0x55
MOV 0x10, A
COMA 0x10
;
Acc = 0xAA, R10 unchanged
COMA 0x0C
;
Acc = toggle of port 2, port 2 unchanged