I'd like to move a nibble from Accumulator to upper nibble of P1.
For now, I set the nibble bit by bit
MOV C, ACC.3
MOV P1.7, C
MOV C, ACC.2
MOV P1.6, C
MOV C, ACC.1
MOV P1.5, C
MOV C, ACC.0
MOV P1.4, C
which seems like a poor way to me: it costs 12 instruction cycles and the code is long. I hoped SWAP
and XCHD
would do the trick, but indirect addressing doesn't seem to work in SFR memory area.
Is there any quicker or shorter (not necessarily both) way to code it? I'd like to leave the lower nibble of P1 untouched.