Question

I don't get what is the difference.

Was it helpful?

Solution

When you are using instructions like movsb, si is considered as the source register, while di is considered as the destination register. But they are both normal x86 registers.

OTHER TIPS

My assembly is a bit rusty, but one's the Source Index, the other the Destination Index. An instruction like movsb will copy a byte from the memory location pointed at by SI, and move it to the memory location pointed at by DI, and then increment both, so if you want to copy the byte stored at SI+1 to DI+1, it only takes a further movsb instruction.

SI stands for source index. Source index is use as a pointer to the current character being read in a string instruction(LODS,MOVS, or CMPS). Source index is also available as an offset to add Bx or Bp when doing indirect addressing.
example:

MOV [Bx + SI] , Ax  

This instruction copies the contents of Ax into the memory location whose address is the sum of the Bx and SI.

DI stands for destination index, used as a pointer to the current character being written or compared in a string instruction.

It is also available as an offset just like SI.

as told above di stands for destination index and si stands for source index, when we want to move data from memory we use si eg, mov ax,[si]. and when we want to move data to the memory we use di. eg, mov [di],ax

both are 16 bit register and cannot be split into 8 bit

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top