UPI-41A/41AH/42/42AH USER’S MANUAL
MOV STS,A Move Accumulator Contents to STS Register
Opcode:
1 0 0 1
0 0 0 0
The contents of the accumulator are moved into the status register. Only bits 4 – 7 are affected.
(STS
4–7
)
w
(A
4–7
)
Example:
Set ST
4
– ST
7
to ‘‘1’’.
MSTS: MOV A,
Ý
0F0H
;SET ACC
MOV STS,A
;MOVE TO STS
MOV T,A
Move Accumulator Contents to Timer/Counter
Opcode:
0 1 1 0
0 0 1 0
The contents of the accumulator are moved to the timer/event-counter register.
(T)
w
(A)
Example:
Initialize and start event counter.
INITEC: CLR A
;CLEAR ACC TO ZEROS
MOV T,A
;MOVE ZEROS TO EVENT COUNTER
STRT CNT
;START COUNTER
MOVD A,Pp
Move Port 4 – 7 Data to Accumulator
Opcode:
0 0 0 0
1 1 p
1
p
0
This is a 2-cycle instruction. Data on 8243 port ‘p’ is moved (read) to accumulator bits 0 – 3.
Accumulator bits 4 – 7 are zeroed.
(A
0–3
)
w
Pp
p
e
4 – 7
(A
4–7
)
w
0
Note:
Bits 0 – 1 of the opcode are used to represent PORTS 4 – 7. If you are coding in binary rather
than assembly language, the mapping is as follows:
Bits
Port
p
1
p
0
0
0
4
0
1
5
1
0
6
1
1
7
Example:
INPPT5: MOVD A,P5
;MOVE PORT 5 DATA TO ACC
;BITS 0 – 3, ZERO ACC BITS 4 – 7
MOVD Pp,A
Move Accumulator Data to Port 4, 5, 6 and 7
Opcode:
0 0 1 1
1 1 p
1
p
0
This is a 2-cycle instruction. Data in accumulator bits 0 – 3 is moved (written) to 8243 port ‘p’.
Accumulator bits 4 – 7 are unaffected. (See NOTE above regarding port mapping.)
Example:
Move data in accumulator to ports 4 and 5.
OUTP45: MOVD P4,A
;MOVE ACC BITS 0 – 3 TO PORT 4
SWAP A
;EXCHANGE ACC BITS 0 – 3 AND 4 – 7
MOVD P5,A
;MOVE ACC BITS 0 – 3 TO PORT 5
44