Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
50 views

Microprocessor Practical Questions

some questions

Uploaded by

Rèé Tû
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Microprocessor Practical Questions

some questions

Uploaded by

Rèé Tû
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Microprocessor Practical Questions

Data Tranfer Instructions


1. Load 1A 2B 3C, 4D, 5E, 6F and 7A to the accumulator, register A,B,C,D,E,H and L
respectively. Examine the content of each register before and after execution of each
instruction. (Use MVI instruction)
2. Load AABB, CCDD and EEFF into register pair B,D,H respectively (using LXI)
3. Load 4455 H and 6677 H in register pair B and D respectively and exchange their
content. Examine the register contents before and after execution.
4. Write a program to copy content of memory location at 8080 to 8090.
5. Load 11H, 22H, 33H, 44H and 55H into accumulator and registers B,C,D and E
respectively and store these data in memory location starting at D000 H to D004 H.
6. The data 44H and 66H are stored in memory location D000H and D000H respectively.
Write a program to transfer these data to memory location D050 H and D051 H
respectively. (Hint: use LHLD and SHLD)
7. Write a program to exchange the content of register pair B and D with the use of XCHG
instruction. Assume data AABB H and CCDD H are in register pair B and D
respectively. Examine the register contents before and after execution.
Arithmetic operations
1. Two 16-bit data are stored in memory as shown in table below. Write a program to add
16-bit data at memory location 9000 (4790H) and at 9010 (6283H), and display the result
in output ports. Use port A for lower byte and port B for higher byte.
2. Suppose the accumulator content is 25H and register B has 48H. Write a program to
subtract the reg B from accumulator and store the result in reg C. Again swap the acc
content and reg B content and subtract the reg B content from acc content. See the flag
content and the reg content before and after the subtraction.
3. Suppose the memory content is as shown in the table alongside. 8090 63
Write a program to subtract 16-bit data at memory location 8092
8091 79
(2697H) from data at memory location 8090 (7963H). Store the
8092 97
result at memory location 8094 in reverse order. (16-bit data is
8093 26
always stored in two memory locations in reverse order)
8094
8095
4. Suppose the memory content is as shown in table alongside. Write 8084 A2
a program to add the 16-bit data at memory location 8084 with
8085 79
the16-bit data at 8086 and store the result at 8088. Use DAD
8086 4B
instruction in adding 16 bit data. Verify the result with the 16 bit
8087 C4
addition using ADC instruction.
8088
8089
5. The data in the memory is as shown in the table along side. Write a
80A2 FF
program to increase the 16-bit data at memory location 80A2 and
decrease the 16-bit data at memory location 80A4. 80A3 A2
80A4 00
80A5 26
6. Use INR and DCR instructions for the increment and decrement operation to increase 16-
bit data in the above problem? (Hint: use INR and DCR instruction for the lower byte
data)
7. The table along side shows BCD data. Write a program to add the 818A 29
content at memory locations 818A and 818B. Store the BCD result 818B 45
at memory location 818C.
818C
8. Write a program to Add the 16-bit BCD data at memory location 8284 13
8284 with the 16-bit BCD data at 8286 and store the BCD result at 8285 79
8288.
8286 26
8287 48
8288
8289
9. Suppose reg H has 34 and reg D has 12. Write program to subtract BCD value in reg D
from the BCD value in reg H. Store the BCD result in reg H.
10. Using the same data of problem 15 write a program to subtract BCD data at 8286 from
BCD data at 8284 and store the BCD result at 8288.

Logical Operations
1. Write a program to AND the content of reg B and content of memory at 9030. Assume
the content of 9030 as 34 and reg B as 92.
2. Write a program that will check whether D4 bit of data at address 9030 is zero. Just check
the result after the operation.
3. The content of the memory is shown in the figure along side. Write 9024 A2
a program to OR the content of memory location 9024 with the 9025 79
memory location 9025 and store the result at 9026. 9026

4. Write a program to XOR the content of 9027 with the location 9028 9027 4B
and store the content at 9029. 9028 C4
9029
5. Logical instructions can also be used to mask certain bits of a word. Write a program to
complement bit D6 of data at memory location 9025. Assume data as shown in the above
figure.
6. We can complement the accumulator content by using instruction other than CMA How
is that possible? Write a program to illustrate this.
7. Write a program to compare the content of the memory location
8081 36
8081 and 8082. Subtract the memory content at 8082 from 8081
and see whether the flag content is same as the compare instruction 8082 A4
or not. 8083
8. Write a program to check the bit D5 of the content of memory at 9025. Display 1 at port
A if the bit is 1 else displays nothing. Use the rotating instructions after masking. Use the
rotating instruction which uses less no of instructions.
9. Change the program in assignment 8 to display 80H if the bit is 1 else nothing.
The Branching and stack operations
1. Write a program to set zero and parity flags and reset other flags.
2. Write a program to set auxiliary flag and reset parity flag without affecting other flags.
3. Write a program to count the no of bits that are 1 in register A.
4. Write a program to add nos. from one to fifty and display the 16 bit result at port A & B.
5. Write a program that will count up from 00 to FF at port A. Be sure to use PCHL
command.
6. Write a program to transfer the data at 8020 to 8030 if the data is greater than 127. You
can assume data yourself.
7. Write a program to rotate the data 3C in port A. Call a delay subroutine for the delaying.
8. Write a program that will check whether the bit D6 of a number stored at 8123 is 0 and
its bit D3 is 1. If the condition satisfies display the number.
9. Write a program that will check whether the number in reg. B is even or not. If the
number is even display it in port A.

You might also like