Professional Documents
Culture Documents
Ch3 - Prob - Ans Nafisa Emad 2020030166
Ch3 - Prob - Ans Nafisa Emad 2020030166
Ch3 - Prob - Ans Nafisa Emad 2020030166
ID : 2020030166
Sheet ch3_prob
(AX)
o MOV DS, AX ; Move the value in AX (1000H) to
the data segment register (DS)
15. The PUSH and POP instructions always transfer a(n)
_____-bit number between the stack and a register or
memory location in the 80386-Core2 microprocessors
when operated in the 32-bit mode.
Ans:
The answer depends on the operand size prefix
used with the instruction. In 32-bit mode without a
size prefix, PUSH and POP transfer a 32-bit number.
With a size prefix (e.g., PUSHF, POPA), they might
transfer 16-bit or 8-bit values depending on the
specific instruction.
CX, DX, SI, DI, BP, SP) onto the stack in 16-bit mode.
EBX, ECX, EDX, ESI, EDI, EBP, ESP) onto the stack in
32-bit mode.
address [SS:SP+1]
BL (Lower-order byte of BX) will be stored at
address [SS:SP]
o Execution of PUSH BX:
Contents of BH (BXH) are stored at memory
address [SS:SP+1]
Contents of BL (BL) are stored at memory
address [SS:SP]
SP is decremented by 2 to reflect the push
operation.
at address [SS:SP+3]
EAXL (Second highest-order byte of EAX) will be
at address [SS:SP]
o Execution of PUSH EAX:
Contents of EAXH (EAXH) are stored at memory
address [SS:SP+3]
Contents of EAXL (EAXL) are stored at memory
address [SS:SP+2]
Contents of EAXBH (EAXBH) are stored at
memory address [SS:SP+1]
Contents of EAXBL (EAXBL) are stored at
memory address [SS:SP]
23. The 16-bit POP instruction (except for POPA)
increments SP by _____
o The 16-bit POP instruction (except for POPA)
increments SP by 2.
then:
SP: The value of SP would depend on the current
segment descriptor
into BX.
o LSS: Loads a segment descriptor for a stack segment
into SS.
memory.
o DI: Destination index register (points to the
destination memory location).
o SI: Source index register (points to the source
memory location).
times
ESI registers
o ; Exchange SI with DI
o XCHG SI, DI
constant value)
51. What is accomplished by the CMOVNE CX,DX
instruction in the Pentium 4 microprocessor?
Ans :
o This instruction conditionally moves the value from
of a procedure (function).
o The ENDP directive marks the end of the procedure.
.model small
.data
DATA4 DW 1234H ; Sample data word
.code
.proc CopyFarData
; Get address of DATA4 (far pointer)
mov AX, offset DATA4
mov DS, AX ; Set DS to segment of DATA4
; Copy data to registers
mov BX, [AX] ; Copy data from DATA4 to BX
mov CX, [AX+2] ; Copy data from DATA4+2 to CX
; ... repeat for DX and SI
mov DX, [AX+4]
mov SI, [AX+6]
ret ; Return from the procedure
.endp