Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the practical difference between the SI and DI registers?

I don't get what is the difference.

like image 960
tatsuhirosatou Avatar asked Sep 27 '09 18:09

tatsuhirosatou


2 Answers

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.

like image 194
Pierre Bourdon Avatar answered Sep 30 '22 19:09

Pierre Bourdon


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.

like image 45
Michiel Buddingh Avatar answered Sep 30 '22 18:09

Michiel Buddingh