Hi,
The segments are calculated at a 16-byte boundary so T may not be the same as DATA. There is also a SPACE in front of A in the first sample but not the second.
Good catch, thanks. The DATA area is called a segment (using
the SEGMENT directive) but it can be byte-aligned. The segment
registers are limited to a 16 byte resolution. According to a
textbook, the default alignment of DATA is a paragraph (16 bytes)
for earlier processors, and DWORD (8 bytes) when using a .80386
directive. And presumably then, for all of the 32-bit processors.
Old textbook. And other alignment types can be specified.
So an address of a variable is its offset from the start of the DATA
area, plus the DATA area's offset from a 16-byte alignment.
Regards,
Steve
P.S. While I was typing, you added a WORD aligned example. It
is not that the CODE and DATA areas overlap as such, but that the
DATA area is not on a 16-byte boundary. The addressing of the
segment registers "overlap".
P.P.S. My code is usually set up to have the DATA area on a 16-byte
boundary. So I forgot that it need not be aligned.
SRN
SRN