Sunteți pe pagina 1din 5

Home Assignment (Lockdown Period)

IAP-2034

1. Specify the register contents and the flag status as the following instructions are
executed. Specify also the output at PORTO.
A B S Z CY
Initial content 00 FF 0 1 0
MVI A, F2H
MVI B,7AH
ADD B
OUT PORTO
2. Specify the register contents and the flag status as the following instructions are
executed.
A B S Z CY
Initial content 00 FF 0 1 0
SUB A
MOV B, A
DCR B
INR B
SUI 01H
HLT
3. Specify the register contents and the flag status as the following instructions are
executed.
A B S Z CY
Initial content 00 FF 0 1 0
XRA A
MVI B, 4AH
SUI 4FH
ANA B
HLT
4. Write an ALP(8085) to load the bit pattern 91H in register B and 87H in register
C. Mask all the bits except D0 from registers B and C. If D0 is at logic 1 in both
registers, turn on the light connected to the D0 position of output port 01H;
otherwise, turn off the light.

Utpal Sarma

Page 1 of 5
Home Assignment (Lockdown Period)
IAP-2034

5. What is the output at PORT 1 when the following instructions are executed?
MVIA, 8FH
ADI 72H
JC DSPLAY
OUT PORT1
HLT
DSPLAY: XRA A
OUT PORT1
HLT
6. In the following program, explain the range of the bytes that will be displayed at
PORT2.
MVI A, BYTE1
MOV B, A
SUI 50H
JC DELETE
MOV A, B
SUI 80H
JC DSPLAY
DELETE: XRA A
OUT PORT1
HLT
DSPLAY: MOV A,B
OUT PORT2
HLT
7. Write instructions to load two unsigned numbers in register B and register C,
respectively. Subtract (C) from (B). If the result is in 2's complement, convert the
result in absolute magnitude and display it at PORT1; otherwise, display the
positive result. Execute the program with the following sets of data.
8. Data bytes are stored in memory locations from 8050H to 805FH. To insert an
additional five bytes of data, it is necessary to shift the data string by five memory
locations. Write a program to store the data string from 8055H to 8064H. Use any
sixteen bytes of data to verify your program.

Utpal Sarma

Page 2 of 5
Home Assignment (Lockdown Period)
IAP-2034

9. A system is designed to monitor the temperature of a furnace. Temperature


readings are recorded in 16 bits and stored in memory locations starting at 8160H.
The high-order byte is stored first and the low-order byte is stored in the next
consecutive memory location. However, the high-order byte of all the temperature
readings is constant. Write a program to transfer low-order readings to consecutive
memory locations starting at XX80H and discard the high-order bytes.
Temperature Readings (H) 0581 , 0595, 0578, 057 A, 0598
10. A string of eight data bytes is stored starting from memory location 8050H. The
string includes some blanks (bytes with zero value). Write a program to eliminate
the blanks from the string. Data(H): F2, AF, 00, 00, 4A, 98, 00, 46
11. Specify the contents of memory locations 8070H to 8074H after execution of
the following instructions.
LXI H, 8070H
MVI B,05H
MVI A,01
STORE: MOY M, A
INR A
INX H
DCR B
JNZ STORE
HLT
12. Identify the contents of the registers, the memory location (XX55H), and the
flags as the following instructions are executed.
A H L s z CY M(8055H)
LXI H, 8055H
MVI M, 8AH
MVI A,76H
ADD M
STA 8055H
HLT
13. The following program adds the number of bytes stored in memory locations
starting from 8000H and saves the result in memory. Read the program and
answer the questions given below.

Utpal Sarma

Page 3 of 5
Home Assignment (Lockdown Period)
IAP-2034

LXl H, 8000H ;Set up HL as a data pointer


LX l D, 0000H ;Set up D as a byte counter and E as a Carry register
NEXT: ADD M ;Add byte
JNC SKIP ;If the result has no carry , do not increment Carry register
INR E
SKIP: DCR D ;Update byte counter
JNZ NEXT ;Go to next byte
LXI H, 8090H
MOV M ,A ;Save the result
INX H
MOV M, E
HLT
a. Assuming the byte counter is set up appropriately, specify the number of
bytes that are added by the program.
b. Specify the memory locations where the result is stored. c. Identify the two
errors in the program.
14. Calculate the delay in the following loop, assuming the system clock period is
0.33 µs:
8085
Label Mnemonics T-states
LXI B, 12FFH 10
DELAY: DCX B 6
XTHL 16
XTHL 16
NOP 4
NOP 4
MOY A,C 4
ORA B 4
JNZ DELAY 10/7
15. Specify the number of times the following loops are executed.

Utpal Sarma

Page 4 of 5
Home Assignment (Lockdown Period)
IAP-2034

a. MVI A,17H
LOOP: ORAA
RAL
JNC LOOP
b. MVIA,17H
LOOP: RAL
ORA A
JNC LOOP
c. LXI B, 1000H
LOOP: DCX B
NOP
JNZ LOOP
16. Write an 8085 ALP to convert a two-digit packed BCD to Binary.
17. Write an 8085 ALP to convert an 8-bit binary to packed BCD.
18. Write an 8085 ALP to convert an 8-bit binary number to ASCII hex code.

Utpal Sarma

Page 5 of 5

S-ar putea să vă placă și