help please

Thread Starter

bleach118

Joined Dec 4, 2008
15
i was asked to store the most significant nibble of A in both nibbles of R5; for example a = b6h then r5 = bbh
am confused in how to solve it can u please help


thanks
 

beenthere

Joined Apr 20, 2004
15,819
I'm sure you can store the value in another register, shift the value up to the high nibble, add the two values, and store them in the location.
 

silvrstring

Joined Mar 27, 2008
159
I don't know the assembly language for the 8051, but you should be able to:

AND A with f0h
STORE A to R5
logical SHIFT right A 4 times (actually, I think you can 'SWAP' the nibbles of A with the 8051)
OR A with R5
STORE A to R5
 
Top