
19-42
x86 MICROPROCESSORS
iv) RRC A: Rotate right through carry
The A register is shifted right and the carry bit is moved to D7, while D0 moves into
the carry. See Fig. 19.20.
v) SWAP A: This is a special instruction where the lower and upper nibbles of A are
swapped. See Fig. 19.21.
Example 19.16
Read in data from port 0. Only the upper four bits of this data is needed. Take the upper
four bits and send it as an output nibble to the lower four bits of port 1.
Solution
ORG 0
MOV P0,#0FFH ;make P0 an input port
MOV A,P0 ;move the content of Port0 to A
ANL A,#0F0H ;mask the lower nibble of A
SWAP A ;switch the upper and lower ...