Question: . Write programs( assembly ) that will accomplish the desired tasks listed below, using as few lines of code as possible. Use only opcodes that

. Write programs( assembly ) that will accomplish the desired tasks listed below, using as few lines of code as possible. Use only opcodes that have been covered in class. Comment on each line of code.( microcontroller of 8051)

14. Copy the internal code byte at address 0300h to external RAM address 0300h

15. Swap the bytes in TIMER 0 ; put TL0 in TH0 and TH0 in TL0

16. Store DPTR in external RAM locations 0123h (DPL) and 02BCh (DPH)

17. Exchange both low nibbles of registers R0 and R1 ; put the low nibble of R0 in R1, and the low nibble of R1 in R0

18. Store the content of register R3 at the internal RAM address contained in R2. (Be sure the address in R2 is legal)

19. Store the content of RAM location 20h at the address contained in RAM location 08h

20. Store register A at the internal RAM location address in register A

21. Copy program bytes 0100h to 0102h to internal RAM locations 20h to 22h

22. Copy the data on the pins of port p2 to the port 2 latch

23. PUSH the contents of the B register to TMOD

24. Copy the contents of external code memory address 0040h to IE

25. Show a set of XCH instructions executes faster than PUSH and POP when saving the contents of the A register.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!