Madan Mohan Malaviya University Of Technology, Gorakhpur
Electronics and Communication Engineering Department
MICROCONTROLLER AND EMBEDDED SYSTEMS (BEC-351)
TUTORIAL - UNIT-III
By Dr. Ishwar Chandra Yadav
1. Explain with examples the different addressing modes supported by 8051 CPU.
2. What is the difference between Immediate addressing and Indexed addressing? State where these
addressing techniques are used. Give an example for each.
3. What is Data transfer instruction? Explain the different data transfer instructions supported by
8051 CPU.
4. Explain the arithmetic operations/instructions supported by 8051 CPU.
5. Explain the stack memory related data transfer instructions in detail.
6. Explain the data exchange instructions in detail with examples.
7. Explain the difference between ADD, ADDC and DAA instructions. Explain the signifi cance of
DAA instruction?
8. Explain the instruction for division operation. How is a divide by zero condition handled in the
8051 architecture?
9. Explain the different logical operations supported by 8051 and the corresponding instruction in
detail.
10. Explain the different Boolean instructions supported by 8051.
11. Explain the different unconditional and unconditional program control transfer instructions sup-
ported by 8051.
12. The 8051 status register doesn’t contain a zero flag. Explain how the 8051 architecture implements
the Jump on zero and Jump on non-zero conditions.
13. Explain the difference between LCALL and ACALL for subroutine invocation? Which one is faster
in execution and why?
14. Explain the difference between RET and RETI instructions.
15. Explain the different types of jumps supported by 8051 architecture. Which one is faster in execution
and why?
16. Write a 8051 assembly language program to find the largest/ smallest number from an array of 10
numbers. The array is located in the data memory and the start address of the array is 30H.
17. Find the number of times the following loop is repeated.
MOV R2, #100
THERE: MOV R3,# 50
HERE: DJNZ R3, HERE
DJNZ R2, THERE
18. Write a subroutine to count the number of 1’s in a byte. Main program reads the byte from port
1. Save the result into top of the stack.
19. Write a 8051 assembly language program to convert given 8-bit binary number into its equivalent
Gray number
20. Write a 8051 assembly language program to convert an 8-bit Gray number into its equivalent binary
number.
21. Write a 8051 assembly language program to arrange a given array of 10 elements in an ascending
order.
22. What are the instructions used to start and stop the timers?
23. Find the count to be loaded into timer registers to generate a time delay of 500 µs and also write
a program for the same using Timer 0 Mode 1. Assume crystal frequency is 12 MHz.
24. Write a 8051 assembly language program using mode 0/1/2 to generate a square wave of 1 KHz
frequency on P2.0. Assume crystal frequency is 12 MHz.
25. Write a program to count external pulses applied to Timer 1 input T1 (P3.5 pin). Display contin-
uously the count on P2 (LSByte) and P1 (MSByte).
Page 2