Assembly Language: Determining an effective address

AI Thread Summary
The discussion focuses on calculating the effective address in assembly language given specific register values. The effective address is derived by adding the data segment (DS) value, shifted left by 4 bytes, to the offset from ESI and EDI. However, the lack of values for ESI and EDI presents a challenge in determining the offset. Additionally, it is noted that 32-bit operations typically occur in protected mode, where segment registers do not influence the virtual address space. The conversation highlights the complexities of addressing modes in assembly language, particularly when transitioning between 16-bit and 32-bit operations.
JJBladester
Gold Member
Messages
281
Reaction score
2

Homework Statement



If EAX contains 00000200H, EBX contains 00000003H, and the data segment contains 1000H, what is the effective address generated by this instruction?

MOV ECX,[ESI][EDI]

The Attempt at a Solution



I know that an effective address is created by adding the data segment (DS) value shifted left 4 bytes to the offset value.

In the question, I am given the values contained in EAX, EBX and DS but I do not know what ESI and DSI are set to, so how can I calculate the offset of ESI + DSI?

I know that [ESI][DSI] is another way of writing [ESI + DSI].
 
Physics news on Phys.org
There are multiple issues with this problem. As you mentioned, no values are given for ESI or EDI. Also normally 32 bit operations are done in protected mode, where normaly the address space is "flat" and the segment registers are not used to affect the virtual 32 bit addresses. In 16 bit real mode, 32 bit overrides can be used to perform 32 bit operations in 16 bit mode, but that is somewhat unusual, mostly done in the BIOS of a PC at boot time.
 
Back
Top