Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What segment is used by default in x86 indirect addressing?

Tags:

x86

assembly

I'm a little confused as to exactly what segment is used when you have x86 assembly like the below (Intel syntax):

mov ax, [di]

I'm pretty certain it wouldn't be the code segment, I'm thinking either the data segment or the stack? (Or is the stack part of the data segment?)

like image 304
PeterBelm Avatar asked Feb 04 '23 01:02

PeterBelm


1 Answers

DS is the default, except with BP indexing then SS is used. This exception is to ease the use of a stack frame (ENTER/LEAVE instructions). The string instructions have specific segment usage as well.

like image 133
bitRAKE Avatar answered Feb 16 '23 02:02

bitRAKE