views:

228

answers:

3

I don't get what is the difference.

+3  A: 

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.

Michiel Buddingh'
+11  A: 

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.

Pierre Bourdon
A: 

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

anjali dhasmana
you can use both mov [si],ax and mov ax, [di], if you are using simple MOV instruction they are basically the same, just as you can use mov [bx], ax. When you are using instructions like MOVSB then the CPU assumes the SI is source and DI is destination, but when you do it manually you can use either to do both.
Bob