Assembly Language: Determining an effective address

Click For Summary
SUMMARY

The discussion focuses on calculating the effective address in assembly language using the instruction MOV ECX,[ESI][EDI]. Given the values EAX = 00000200H, EBX = 00000003H, and the data segment (DS) = 1000H, the effective address is determined by adding the DS value shifted left by 4 bytes to the offset derived from ESI and EDI. However, the lack of specific values for ESI and EDI complicates the calculation, as these registers are essential for determining the final effective address. The conversation highlights the nuances of 32-bit operations in protected mode versus 16-bit real mode.

PREREQUISITES
  • Understanding of assembly language syntax and operations
  • Knowledge of x86 architecture, specifically registers EAX, EBX, ESI, and EDI
  • Familiarity with data segment (DS) and effective address calculation
  • Concept of protected mode versus real mode in x86 systems
NEXT STEPS
  • Study the concept of effective address calculation in assembly language
  • Learn about the role of segment registers in x86 architecture
  • Explore the differences between protected mode and real mode in x86 systems
  • Investigate the use of 32-bit overrides in 16-bit assembly programming
USEFUL FOR

Students studying computer architecture, assembly language programmers, and anyone interested in low-level programming and effective address calculations in x86 systems.

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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
7K
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 9 ·
Replies
9
Views
4K