Vous êtes sur la page 1sur 1

1. Write an assembly language program (ALP) to find average of first n natural numbers.

2. Write an ALP to perform a division of two 8 bit data and store the result in memory.
3. Write an ALP to perform a subtraction of two 8 bit data and store the result in memory.
4. Write an ALP to perform multiplication of 8 bit data and store the result in memory.
5. Write an ALP to convert BCD number into ASCII using 8051 microcontroller.
6. Write an ALP to represent -6 and 0128 in 8 bit binary using 2’s complement representation.
7. Write and ALP to generate a delay of 10 seconds.
8. Write an ALP to load a byte in memory location 9000H and increment the contents of the
memory locations.
9. Write an ALP to store 01 H, 02H, 03H and 04H in register R0, R1, R2 and R3 respectively and
exchange data stored in register R0 with R1 and data in register R2 with R3.
10. Write an ALP to generate Fibonacci series.
11. Write an ALP to find factorial of a number.
12. Write an ALP for multiplying two 16 bit hexadecimal numbers.
13. Write an ALP to find largest number in an array.
14. Write an ALP to generate a 10 kHz square wave.
15. Write an ALP to generate a rectangular wave of 75% duty cycle on pin P1.0.
16. Write an ALP to find the square of a number stored at internal RAM address 50H. Store the
result at address 60H (LSByte) and 61H (MSByte). If the number is AAH, what will be the result
and status of OV flag after finding the square of that number?
17. Add three numbers stored at internal RAM address 10H, 11H, 12H and store the lower byte of
result into internal RAM address 22H and upper bits into 21H.
18. Write instructions to subtract 10H from 30H using immediate and register addressing modes.
19. Write an ALP to read status of the pin P2.1 and send its complement to P1.0.
20. Write an ALP to toggle pin P1.0 continuously if P2.0 is high, otherwise clear P1.0.
21. Write an ALP to EX-OR first and second bits of accumulator and save the result in third bit of
accumulator.
22. Realize single bit EX-OR instruction using other bit processing logical instruction.
23. Assume that a switch is connected to pin P1.1 and the LED is connected to pin P1.2. Write a
program to read the status of switch and send this status to LED.
24. Write an ALP to transmit an ASCII character ‘Z’ continuously with a baud rate of 19200 with a
crystal frequency of 11.0592MHz.
25. Read the contents of ports P0, P1 and transfer their contents serially one after other at a baud
rate 4800.
26. Interface the DAC 0808 with 89C51 and write a program to generate a sawtooth wave.
27. Copy the contents of register R0 to R7 into internal RAM addresses 40H to 47H respectively
using PUSH instructions. Assume bank 0 is selected.
28. Write an ALP to add 5 to A register 10 times.
29. Write an ALP to read P0 and send its value on port P2 500 times.
30. Write a subroutine to convert a 8bit binary number which is stored in accumulator into an
equivalent BCD number.

Vous aimerez peut-être aussi