help please

Discussion in 'Homework Help' started by bleach118, Dec 20, 2008.

  1. bleach118

    Thread Starter Member

    Dec 4, 2008
    15
    0
    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
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. bleach118

    Thread Starter Member

    Dec 4, 2008
    15
    0
    am not getting u but can u please help me by solving it
    am using 8051μc


    thanks
     
  4. silvrstring

    Active Member

    Mar 27, 2008
    159
    0
    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
     
Loading...