2014 Midsem Solution
2014 Midsem Solution
2014 Midsem Solution
(Credit - 4)
Jabir Hussain
([email protected])
School of Electronics Engineering
KIIT University
1 (a). POP B
Opcode Fetch M/C with 4 T-states, Memory Read M/C and Memory Read M/C.
1 (c). 8085 requires 10 T-states to execute the MVI M,25H instruction. According to
the question, crystal frequency, fX is 4MHz.
fX = 4MHz
fX
fµP =
2
∴ Clock frequncy, fµp = 2 MHz
1
Now, 1T-state = = 0.5 µs
fµp
Time taken to execute the instruction is 10 × 0.5 µs = 5 µs
1 (e).
0 0 0 1 1 0 0 1
1
Part Two
2 (b).
S Z x AC x P x C
1 0 0 1 0 1 0 0
2 (d). Stack operation: The stack can be described as a set of memory locations which
are used to temporarily store information during the execution of a program. In 8085,
the instructions PUSH and POP are used to perform stack related operations. The stack
pointer register tracks the storage and retrieval of the information. Because two data
bytes are being stored at a time, the 16-bit memory address in the stack pointer register
is decremented by two; when data bytes are retrieved, the address is incremented by two.
2
Part Three
3 (a). i) SHLD 4000H : Store H and L Registers Direct – Direct Addressing Mode.
Contents of L reg. is stored in 4000H and contents of H reg. is stored in 4001H
ii) RAL : Rotate Accumulator left through Carry – Implicit Addressing Mode.
Cy
A7 A6 A5 A4 A3 A2 A1 A0
An+1 ← An
Cy ← A7
A 0 ← Cy
MVI A,1CH 0 0 0 1 1 1 0 0
SIM
3
Timing Diagram of LDAX D instruction
T1 T2 T3 T4 T1 T2 T3
CLK
4
ALE
register pair is F150H and contents of accumulator is 56H
IO/M, S1 , S0
IO/M = 0, S1 = 1, S0 = 1 IO/M = 0, S1 = 1, S0 = 0
RD bc bc
bc bc
WR
3 (d). Timing diagram of LDAX D is shown below. It is assumed that the content of DE
Part Four
4. Data transfer Between any register and I/O Only between I/O and the
accumulator
5
LOOP: INX H
CMP M
JNC AHEAD
MOV A,M
AHEAD: DCR C
JNZ LOOP
STA 0F520H; According to the question, result is stored at XX20H
RST 1
ORG 0F500H; Define 16 bytes of Data
DB 62H,55H,98H,47H,98H,27H,32H,26H
DB 23H,42H,68H,82H,32H,12H,52H,61H
END
4 (d). RST 3 : DF → 1 1 0 1 1 1 1 1
+5V
In response to
the Interrupt
Tri-state Buffer Request (INTR),
1
b
DI7 8085 sends the
1
INTA (Interrupt
b
DI6
b
Acknowledge)
0
DI5 low signal. This
b
1
is used to enable
b
DI4
b
the buffer and
DFH To Data Bus
1
b
DI3 the corresponding
b
RST instruction
1
b
DI2
b
is placed on the
1
b
DI1 data bus.
b
1
DI0
b
bc
ENABLE