8051

8051 Program to Rotate DPTR value

Output
8051 Program to Rotate DPTR Value. 
ALGORITHM:
  1. Start.
  2. Load the value to be rotated in DPTR.
  3. Move the Lower nibble of DPTR in Accumulator.
  4. Rotate Left 8 bits along with carry.
  5. Move the Upper nibble of DPTR in Accumulator.
  6. Rotate Left 8 bits along with carry.
  7. Now we got the Upper nibble of DPTR move it to DPH.
  8. Move the Lower nibble of DPTR in Accumulator.
  9. Rotate Left 8 bits along with carry.
  10. Now we got the Lower nibble of DPTR move it to DPL.
  11. The output is stored in the DPTR.
  12. End.

For example if we are trying to rotate the number as below.

After rotating the DPTR the value will be:

! Information
To get details about instructions used visit Keil Website.

CODE: