As we all know, we can read the value of an address using square brackets in NASM, such as that:
mov esi, [ebp +8]
mov edi, [var] --> (var is a variable)
Those values in square brackets represent the offset address, but when we read values using that format, we absolutely need a segment, whether we are in real or protected mode, so what's the default segment register that NASM uses? I know that Windows uses flat mode, but if I set different values to different segment register(cs, ss, ds, es, fs, gs), which segment register will NASM use? I guess it is ds
, right? Is the segment register different when using different expressions in square brackets? Is the default segment register the same both in real and protected mode? Thanks.