UPI-41A/41AH/42/42AH USER’S MANUAL
SWAP A
Swap Nibbles Within Accumulator
Opcode:
0 1 0 0
0 1 1 1
Bits 0 – 3 of the accumulator are swapped with bits 4-7 of the accumulator.
(A
4–7
)
Ý
(A
0–3
)
Example:
Pack bits 0 – 3 of locations 50-51 into location 50.
PCKDIG: MOV R0,
Ý
50
;MOVE ‘50’ DEC TO REG 0
MOV R1,
Ý
51
;MOVE ‘51’ DEC TO REG 1
XCHD A,
@
R0
;EXCHANGE BIT 0 – 3 OF ACC
;AND LOCATION 50
SWAP A
;SWAP BITS 0 – 3 AND 4 – 7 OF ACC
XCHD A,
@
R1
;EXCHANGE BITS 0 – 3 OF ACC AND
;LOCATION 51
MOV
@
R0,A
;MOVE CONTENTS OF ACC TO
;LOCATION 51
XCH ARr
Exchange Accumulator-Register Contents
Opcode:
0 0 1 0
1 r
2
r
1
r
0
The contents of the accumulator and the contents of working register ‘r’ are exchanged.
(A)
Ý
(Rr)
r
e
0 – 7
Example:
Move PSW contents to Reg 7 without losing accumulator contents.
XCHAR7: XCH A,R7
;EXCHANGE CONTENTS OF REG 7
;AND ACC
MOV A,PSW
;MOVE PSW CONTENTS TO ACC
XCH, A,R7
;EXCHANGE CONTENTS OF REG 7
;AND ACC AGAIN
XCH A,
@
Rr
Exchange Accumulator and Data Memory Contents
Opcode:
0 0 1 0
0 0 0 r
The contents of the accumulator and the contents of the data memory location addressed by
bits 0 – 7 of register ‘r’ are exchanged. Register ‘r’ contents are unaffected.
(A)
Ý
((Rr))
r
e
0 – 1
Example:
Decrement contents of location 52.
DEC 52: MOV R0,
Ý
52
;MOVE ‘52’ DEC TO ADDRESS
;REG 0
XCH A,
@
R0
;EXCHANGE CONTENTS OF ACC
;AND LOCATION 52
DEC A
;DECREMENT ACC CONTENTS
XCH A,
@
R0
;EXCHANGE CONTENTS OF ACC
;AND LOCATION 52 AGAIN
51
Содержание UPI- 41A
Страница 1: ...October 1993 Microprocessor Peripherals UPI 41A 41AH 42 42AH User s Manual Order Number 231318 006 ...
Страница 4: ......
Страница 12: ...UPI 41A 41AH 42 42AH USER S MANUAL 231318 7 Figure 2 2 Pin Configuration 231318 8 Figure 2 3 Logic Symbol 8 ...
Страница 65: ...UPI 41A 41AH 42 42AH USER S MANUAL 231318 42 Figure 5 11 Distributed Processor System 61 ...