Assembly Language: Determining an effective address

In summary, the question provided insufficient information to calculate the effective address generated by the instruction MOV ECX,[ESI][EDI]. The values for ESI and EDI are not given and it is unclear whether the operation is being performed in protected mode or 16 bit real mode, which would affect the use of segment registers.
  • #1
JJBladester
Gold Member
286
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
  • #2
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.
 

1. What is an assembly language?

An assembly language is a low-level programming language that is specific to a particular computer architecture. It uses mnemonic codes and symbols to represent machine instructions, making it easier for humans to write and understand code at a hardware level.

2. How is an effective address determined in assembly language?

An effective address in assembly language is determined by the combination of a base address and an offset. The base address is the starting address of a memory location, and the offset is the distance from that address to the specific data or instruction being accessed.

3. What is the purpose of determining an effective address in assembly language?

Determining an effective address in assembly language is important for accessing and manipulating data and instructions in memory. It allows the programmer to specify exactly where in memory they want to read from or write to, making the code more efficient and precise.

4. How is an effective address calculated in assembly language?

The calculation of an effective address in assembly language depends on the addressing mode used. Some common methods include adding a constant value to a base address, using a register to hold the offset, or using a displacement from the base address. The specific calculation will vary depending on the processor architecture and instruction set.

5. Can effective addresses be modified during program execution in assembly language?

Yes, effective addresses can be modified during program execution in assembly language. This can be done by using instructions that manipulate the base address or offset, or by using indirect addressing modes that allow for dynamic changes to the effective address. This allows for more flexibility and dynamic programming in assembly language.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
7K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
Back
Top