Question
Click Here
Answer
Step 1 of 2
T he physical address of the segment register can be calculated as follows:
Physical address = (segment register value × 10h) + offset address
= (0C4Bh × 10h) + ADE0h
= 0C4BADE0h
Expalantion
T he base address of the segment register is the physical address, and the top
address can be calculated by adding the segment size to the base address. Since
the segment size is not given, we cannot determine the top address.
T he default segment and offset registers list for the 8086 microprocessor is as
follows:
Segment Register
CS IP
DS SI
SS SP
ES DI
Step 2 of 2
Now, let's analyze the given instructions:
I. MOV [SI], DS - T his instruction is not right because it is trying to move the value of
the DS register to the memory location pointed by the SI register, which is not
allowed. T he correct instruction should be MOV DS, [SI], which moves the value
stored in the memory location pointed by the SI register to the DS register.
II. INSB - T his instruction is right. It reads a byte from the input port whose address is in
DX, and stores it in the memory location pointed by the ES:DI register pair. T he DI
register is automatically incremented or decremented, depending on the state of
the DF flag.
III. MOV SS, DS - T his instruction is not right because it is trying to move the value of
the DS register to the SS register, which is not allowed. T he correct instruction should
be MOV DS, SS, which moves the value of the SS register to the DS register.
IV. REP LODSB - T his instruction is right. It reads a byte from the memory location
pointed by the DS:SI register pair and stores it in the AL register. T he SI register is
automatically incremented or decremented, depending on the state of the DF flag.
T he instruction is repeated CX times (if the CX register is used as a counter).
Expalantion
T he given operations are explained in the above step
Final Answer
When the PUSHA instruction executes, it pushes the values of all the general-purpose
registers (AX, CX, DX, BX, SP, BP, SI, and DI) onto the stack in the following order:
SP = SP - 2 (push DI)
SP = SP - 2 (push SI)
SP = SP - 2 (push BP)
SP = SP - 2 (push BX)
SP = SP - 2 (push DX)
SP = SP - 2 (push CX)
SP = SP - 2 (push AX)
Assuming that SP = 1008H and SS = 0000H after execution, the physical addresses
where data are stored are as follows:
SS:1000H - DI
SS:1002H - SI
SS:1004H - BP
SS:1006H - BX
SS:1008H - SP
SS:100AH - DX
SS:100CH - CX
SS:100EH - AX