Domanda

I'm a little confused about this following line:

add ax, [si+4]

Does this take the value of SI and add 4H to it, and then add that to AX?

For example, we'll say AX = 1000 and SI = 0010. What would AX's value be?

È stato utile?

Soluzione

It takes the value at SI+4 and adds it to AX. In other words, it adds 4 to SI, retrieves a 16-bit integer value from memory at that address (in the DS segment), and adds that value to AX.

We don't know what will be the value of AX because we don't know what's at address DS:0014. :)

Altri suggerimenti

First of All this is Register Relative Addressing Mode not Based Index.

Assuming that the value of SI is 0010 and not 0010H

it would add 10+4=14 i.e. 'E' so it would be DS:000E H

if you mean 0010H it would be DS:0014H

And at last whatever is in the data segment in the 15th Location in 1st Case and the 20th Location in the second , the content of that will be added to AX.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top