Lab 3 - Questions With Solutions
Lab 3 - Questions With Solutions
For this lab assignment, you will learn the basics of 8085 programming.
ADD B 80 1 byte
HLT 76 1 byte
2. Modify the above program as follows: input 32H should be taken from I/O port 1 and result
should be displayed on I/O port 5. What is the size of program in bytes?
IN 01H DB 01 2 byte
ADD B 80 1 byte
HLT 76 1 byte
3. Data bytes 28H is stored in register B and data byte 97H is stored in the accumulator. Show
the contents of register A, B, and C after the execution of following two instructions: MOV
A,B; MOV C,A.
Register A Register B Register C
97H 28H
Instruction: MOV A, B
Register A Register B Register C
28H 28H
Instruction: MOV C, A
CSD211 Computer Organization and Architecture - Lab 3
4. Find the hex codes, machine codes and no. of bytes of the following instructions:
MVI H, 47H 26 47
ADI F5H C6 F5
SUB C 91
JNZ 2070H C2 70 20
5. Find the Hex code for the following Assembly language program
MVI B,4FH 06 4F
MVI C, 67H 0E 67
MOV A,C 79
ADD B 80
OUT 07H D3 07
HLT 76
6. In the above question, explain the potential result of the program if the code 07H of the
OUT instruction is omitted.
The output result of addition will be performed after processing but output will not be
produced on any output peripheral.
7. If the starting address of memory in system is 2030H, identify the memory address and its
content for each instruction of the following assembly language code. Assuming the
memory address 2051H and 2052H stores data 49H and 9FH respectively and memory
address 2053H will store the result of processing.
MOV B, A 47 2033:47
SUB B 90 2037:90
CSD211 Computer Organization and Architecture - Lab 3
HLT 76 203B:76
2051:49
2052:9F
2053:(RESULT)
8. Write a 8085 assembly code for getting 2’s complement of a number stored at location
2067H and store it on location 2051H.
LDA 2067H
CMA
MVI B,0H
INR B
ADD B
STA 2051H
HLT
OR
LDA 2501H
CMA
ADI, 01 H
STA 2051H
HLT
9. Write an 8085-assembly code to add A2H and 18H – both the numbers should be stored
for future use and final sum should be saved in the accumulator.
i) Load A2H in one register
ii) Load 18H in second register
iii) Copy A2H in accumulator
iv) Add the data of second register to the accumulator
v) End of the program.
If number is not in memory take it immediate in register using MVI and then first store
the number in memory and then perform the operation.
10. Write an 8085 assembly code to implement the following by fetching content from given
memory locations. The code should first store memory location in register then fetch the
content from the memory location stored in register.
CSD211 Computer Organization and Architecture - Lab 3
LXI H, 2501H
MOV A, M
INX H
ADD M
INX H
MOV M, A
HLT
11. Given the following sets of hex codes – identify the mnemonics:
SET 1 SET 2
06 MVI B, Data 06 MVI B, Data
82 ADD D 4F MOV C, A
78 MOV A, B 0E MVI C, Data
32 STA Address 37 STC
50 MOV D, B 78 MOV A, B
20 RIM 81 ADD C
FF RST 7 00 NOP
32 STA Address
35 DCR M
20 RIM
76 HLT