UPI-41A/41AH/42/42AH USER’S MANUAL
XCHD A,
@
Rr
Exchange Accumulator and Data Memory 4-bit Data
Opcode:
0 0 1 1
0 0 0 r
This instruction exchanges bits 0 – 3 of the accumulator with bits 0 – 3 of the data memory
location addressed by bits 0 – 7 of register ‘r’. Bits 4 – 7 of the accumulator, bits 4 – 7 of the data
memory location, and the contents of register ‘r’ are unaffected.
(A
0–3
)
Ý
((Rr
0–3
))
r
e
0 – 1
Example:
Assume program counter contents have been stacked in locations 22-23.
XCHNIB: MOV R0,
Ý
23
;MOVE ‘23’ DEC TO REG 0
CLR A
;CLEAR ACC TO ZEROS
XCHD A,
@
R0
;EXCHANGE BITS 0 – 3 OF ACC
;AND LOCATION 23 (BITS 8 – 11
;OF PC ARE ZEROED, ADDRESS
;REFERS TO PAGE 0)
XRL A,Rr
Logical XOR Accumulator With Register Mask
Opcode:
1 1 0 1
1 r
2
r
1
r
0
Data in the accumulator is EXCLUSIVE ORed with the mask contained in working register
‘r’.
(A)
Ý
(A) XOR (Rr)
r
e
0 – 7
Example:
XORREG: XRL A,R5
;‘XOR’ ACC CONTENTS WITH
;MASK IN REG 5
XRL A,
@
Rr
Logical XOR Accumulator With Memory Mask
Opcode:
1 1 0 1
0 0 0 r
Data in the accumulator is EXCLUSIVE ORed with the mask contained in the data memory
location address by register ‘r’, bits 0 – 7.
(A)
w
(A) XOR ((Rr))
r
e
0 – 1
Example:
XORDM: MOV R1,
Ý
20H
;MOVE ‘20’ HEX TO REG 1
XRL A,
@
R1
;‘XOR’ ACC CONTENTS WITH MASK
;IN LOCATION 32
XRL A,
Ý
data,
Logical XOR Accumulator With Immediate Mask
Opcode:
1 1 0 1
0 0 1 1
#
d
7
d
6
d
5
d
4
d
3
d
2
d
1
d
0
This is a 2-cycle instruction. Data in the accumulator is EXCLUSIVE ORed with an immedi-
ately-specified mask.
(A)
w
(A) XOR data
Example:
XORID: XRL A,
Ý
HEXTEN
;XOR CONTENTS OF ACC WITH
;MASK EQUAL VALUE OF SYMBOL
;‘HEXTEN’
52