0
votes

I was asked the following question, but I don't see how it has enough information to be answered.

"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]

How would I know what values were contained in the ESI and EDI registers? I know the ESI and EDI registers are typically used in string operations...

I also know the general format for creating effective addresses is:

1) Shift DS four bits to the left.

2) Add the shifted DS value to the offset value.

In the code snippet above, the offset is [ESI][EDI] which I believe is the same as [ESI + EDI]. I interpret [ESI][EDI] to mean the following in English:

"The offset is equal to the value contained in the ESI register added to the value contained in the EDI register."

This is my first week in an 8-week x86 microprocessor course so I appreciate the feedback.

1
DSI? There is no DSI register in an 80x86.JJBladester
My previous comment referred to the original, unedited question. I've removed it to prevent further confusion.stakx - no longer contributing

1 Answers

1
votes

The effective address of ds:eax+ebx can be computed this way:

ds =  0x1000 (4096 in decimal)
eax = 0x200  (512 in decimal)
ebx = 3

ds:eax+ebx = 0x10 * 0x1000 + 0x200 + 3

ds:eax+ebx = 0x10203 (66051 decimal)

But nothing can be said about the value of esi and edi based on the values of ds, eax and ebx, as the registers are completely independent, so the effective address of ds:esi+edi cannot be computed neither.