DTM CT2 QB Ans If3
DTM CT2 QB Ans If3
DTM CT2 QB Ans If3
1. State the functions of the following pins of 8086 microprocessor. i) ALE ii) DT/ R
iii) M/ Io iv) HOLD v) NMI vi) INTR vii) BHE’/S7 viii)MN/MX’ ix) DEN’
x)TEST’ xi)Ready
ANS:
i. ALE:- Address Latch Enable: This output signal indicates the availability of
valid address on the address/data bus, and is connected to latch enable input of
latches.
ii. DT/R:- Data transmit/Receive: This output signal is used to decide the direction
of date flow through the bi- directional buffer. DT / R* = 1 Indicates transmitting
and DT / R* = 0 indicates receiving the data.
iii. M/IO:- This signal selects either memory operation or I/O operation. This line
indicates that the microprocessor address bus contains either a memory address
or an I/O port address. The signal high at this pin indicates a memory operation.
This line is logically equivalent to S2 in maximum mode.
iv. HOLD:- The hold input requests a direct memory access (DMA). If the hold
signal is at logic 1, the micro process stops its normal execution and places its
address, data and control bus at the high impedance state.
vii. BHE/S7:- The bus high enable (BHE) signal is used to indicate the transfer of
data over the higher order D15 - D8 data bus. It goes low for the data transfer
over D15 - D8 and is used to derive chip select of odd address memory bank or
peripherals.
viii. MN/MX:- The minimum/maximum mode signal to select the mode of operation
either in minimum or maximum mode configuration. Logic 1 indicates minimum
mode.
ix. DEN:- Data Enable: Data bus enable signal indicates the availability of valid
data over the address/data lines.
x. TEST:- This input is tested by “WAIT” instruction. If the TEST input goes low;
execution will continue. Else the processor remains in an idle state.
xi. READY:- This is the acknowledgement from the slow devices or memory that
they have completed the data transfer operation. This signal is active high.
3. Interpret the given program and specify the o/p for the following situations:
5. State the function of STC, AAA, AAM, IMUL, DAA instructions of 8086
microprocessor
ANS:-
STC: This instruction sets the carry flag.
AAA:
AAM:
IMUL: this instruction is used for the multiplication of signed numbers.
DAA: (decimal adjust for addition)
It makes the result impact BCD form after BCD addition is performed
6. List the logical instruction
ANS:
i. NOT destination
ii. And destination, source
iii. Or destination, source
iv. Ex- OR destination, source
v. Test destination source
7. Explain the process of physical address calculation and calculate the physical
address of the following.
(1) 4370 H : 561E H
(2) 7A32 H : 6028 H.
ANS: While addressing any location in the memory bank, the physical address is
calculated from two parts
The first is segment address, the segment registers contain 16-bit segment base
addresses, related to different segment.
The second part is the offset value in that segment.
Physical address is calculate as below:
Ex: Segment address (CS) = 1005H
Offset address -- (IP) = 5555H
Physical address = CS * 10 H + IP
= 1005 H * 10 H + 5555 H
= 10050 H + 5555 H
= 155A5 H
6) REP(repeat) :-
i. This is an instruction prefix, which can be used in string instruction.
ii. It causes the instruction to be repeated CX number of times.
iii. After each execution, the SI and DI registers are incremented /
decremented based on the DF(direction flag) and CX is decremented.
iii. A decoder in the EU translates instructions fetched from memory into a series of
actions, which the EU carries out.
iv. The EU has a 16-bit arithmetic logic unit (ALU) which can add, subtract, AND,
OR, XOR, increment, decrement, complement or shift binary numbers.
12. Draw maximum mode configuration of 8086 and explain any four-control signal
generated by bus controller
ANS:
All control signals for memory and IO are generated by 8288 on behalf of 8086
Control signals are generated 8288 bus controller according to requirement of 8086 as
informed by S2, S1 and S0.
Along with control signals like IO/Memory read and write 8288 also generates 𝐼𝑁𝑇𝐴̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅
signal in response to interrupt on INTR.
1 0 0 Halt None
̅̅̅̅̅̅̅
1 0 1 Instruction 𝑀𝑅𝐷𝐶̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
fetch
̅̅̅̅̅̅̅
1 1 0 Read from 𝑀𝑅𝐷𝐶̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
Memory
13. Write an assembly language program to arrange given numbers in ascending order.
• JUMP
i. JMP(unconditional jump):-
In this case the execution control is transferred to the specified location independent
of any status or condition.
For example:-
JMP UP
ii. J condition (conditional jump)
I. This is a conditional branch instruction.
II. In where's the control is transferred to the specified location if the
provided condition is specified.
III. If the condition is false then branch does not take place and the next
sequential instruction is executed.
IV. For example : JNC next
• CALL:
i. This instruction is used to call a subroutine (sub-program) from the main
program.
ii. CALL is an instruction that transfers the program control to a subroutine, with
the intention of coming back to the main program.
iii. Thus in CALL 8086 saves the address of the next instruction into the stack
before branching to the subroutine.
iv. At the end of the subroutine, control transfers back to the main program using
the return address from the stack.
15. Write 8086 assembly language program with algorithm to add two 16 bit numbers.
ANS:
• Model small
• Data
a dw 1234H
b dw 4321H
• Code
Entrypoint:
mov ax, @data
mov ds, ax
mov ax, a
mov bx, b
add ax, bx
mov ah, 4ch
int 21h
ends
end entrypoint
ii. The CPU 8086 can access 1MB of physical memory. The complete 1MB of
memory can be divided into 16 segments, each of 64KB size and is addressed
by one of the segment registers.
iii. The 16-bit contents of the segment register actually point to the starting location of
a particular segment. The address of the segments may be assigned as 0000H to
F000h respectively.
iv. To address a specific memory location within a segment, we need an offset address.
The offset address values are from 0000H to FFFFH so that the physical addresses
range from 00000H to FFFFFH.
Fetching the next instruction while the current instruction executes is called pipelining
ANS: