You are on page 1of 3

Programs

1. WAP to load data 05H into accumulator and then transfer the same data to B reg and H
reg
2. WAP to exchange contents of memory location D000H and D001h
3. WAP to add the contents of memory locations D000H and D001h. Store the result in
memory location D002h
4. WAP to subtract the contents of memory location D001h from the contents of memory
locatioD000h.Store the result in memory location D002h
5. WAP to add the 16 bit number in memory location D000h and D001h with the 16 bit
number in memory locations D002h and D003h. The most significant 8 bits of two
numbers are added in memory locations D001h and D003h. Store the result in memory
location D004h and D005h with MSB in memory location D005h
6. WAP to subtract the 16 bit number in memory location D002h and D003h from the 16 bit
number in memory locations D000h and D001h. The most significant 8 bits of two
numbers are added in memory locations D001h and D003h. Store the result in memory
location D004h and D005h with MSB in memory location D005h
7. WAP to find the 1s compliment of the number stored at memory location C200h and store
the complimented number at memory location C100h.
8. WAP to find the 2s compliment of the number stored at memory location C200h and store
the complimented number at memory location C100h.
9. WAP to mask the lower nibble of an 8 bit number. Assume the 8 bit number is in A reg.
Store the result in B reg.
10. WAP to mask the higher nibble of an 8 bit number. Assume the 8 bit number is in A reg.
Store the result in B reg.
11. WAP to add the contents of 2 digit BCD numbers stored at memory locations D000H and
D001H. Store the result in memory location D002h
12. WAP to add two 4 digit BCD numbers in HL and DE registers pair and store the result in
memory locations D000H and D001H with MSB loaded at D001H. Ignore carry after 16 bit.
13. WAP to calculate the sum of series of a numbers. The length of series is in memory
location D000H.The series begins from D001H. Assuming the sum to be an 8 bit number so
that carry can be ignored. Store the result in memory locations E000H
14. WAP to calculate the sum of series of numbers .The length of series is in memory location
D000h. The series begins from D001H.Assuming the sum to be 16 bit number and store
the result at memory locations E000H and E001H.
15. WAP to sort the given N numbers from a block in ascending order. Assuming that the
memory block begins at D000H.
16. WAP to sort the given N numbers from a block in descending order. Assuming that the
memory block begins at D000H.
17. WAP to multiply two 8 bit numbers stored in memory locations D000h and D001h. Store
the result in memory locations E000h and E001h.
18. WAP to move a block of N bytes of data from source block to destination block. source
memory block starts from memory location D000h and destination memory block starts
from E000h.
19. WAP to divide 16 bit number stored in memory locations D000h and D001H by 8 bit
number stored at memory location D002H. Store the quotient in memory locations E000H
and E001H and remainder in memory locations E002H and E003H
20. Given an array of N numbers. WAP to find the number of negative numbers stored in the
array. Assume the array begins at memory location D001H and memory Location D000h
consists of the size of the array. Store the result at memory location E000H.
21. WAP to find the maximum number amongst the numbers in the array. Assume the array
begins at memory location D001H and memory Location D000h consists of the size of the
array. Store the result at memory location E000H.
22. WAP to pack the unpacked BCD numbers. Assume that the two unpacked digits are
available at memory location D000H and D001h. Assume that the least significant digit is
available in D000H. Store the result at memory location D002H.
23. A two digit BCD number is stored at the memory location D000H. WAP to unpack this BCD
number and store the two digits at memory locations D001h and D002H
24. WAP to shift an eight bit data by four bits to the right. Assume that the data is present in
register B.
25. WAP to shift a 16 bit data by 1 bit to the right. Assume that the data is present in register
pair BC.
26. WAP to shift a 16 bit data by 1 bit to the left. Assume that the data is present in register
pair HL.
27. WAP to count the numbers of 1s in a byte stored in the HL reg and store the result in B
register.
28. WAP to calculate the sum of series of even numbers. Assume that the length of the series
is stored at memory locationD000H and the series itself begins at memory location
D001H. Store the result at memory location E000H.
29. WAP to reverse the contents of a block of N bytes and transfer the reverse contents to
destination block.
30. WAP to find the square of a numbers from memory location D100H and store the result
from location D200H.
31. Given an array of numbers. WAP to find the smallest number amongst the numbers in the
array. Assume that the length of the array is stored at memory location D000H and array
begins from memory location D001H. Store the minimum number at memory location
E000H.
32. WAP to find the 2s complement of two bytes stored at memory locations 9000h and
9001H. Save the corresponding results at memory locations 9002h and 9003H
33. Two 16 bit data items stored are at memory locations 6000h, 6001H and 6002H,
6003H.The LSB of first data is 6000h and LSB of second data is at 6002H. WAP to add these
two 16 bit numbers using DAD instruction and without using DAD instruction
34. WAP to find number of ones in 8 bit data stored in memory location D300H. Save the
result at D2FF memory location.
35. WAP to subtract the contents of register B from the contents of register C and save the
result in register D. Use 2s complement method for subtraction.
36. A block of data is stored at memory location A000h to A0ffH.WAP to prepare a new block
consisting of 2s complement of all the elements of given block. Save the new block in
memory from locationA100H

You might also like