7.2 Absolute addressing
------------------------
Absolute addressing is also possible. There are the same restrictions
on the indexes as in relative addressing.
The index to be calculated is absolute in a segment whose register is
pointed to. Any of registers DS, CS, SS or ES can be pointed to. For 80386
and later, registers FS and GS may also be pointed to.
The syntax is the same as for relative addressing, except that not the
variable but the segment and data type are pointed to. The following
pointers can be used:
// addressing in data segment
DSBYTE [offset] // byte in segment DS is addressed
DSWORD [offset] // word in segment DS is addressed
DSCHAR [offset] // char in segment DS is addressed
DSINT [offset] // int in segment DS is addressed
DSDWORD [offset] // dword in segment DS is addressed
DSLONG [offset] // long in segment DS is addressed
DSFLOAT [offset] // float in segment DS is addressed
// addressing in code segment
CSBYTE [offset] // byte in segment CS is addressed
CSWORD [offset] // word in segment CS is addressed
CSCHAR [offset] // char in segment CS is addressed
CSINT [offset] // int in segment CS is addressed
CSDWORD [offset] // dword in segment CS is addressed
CSLONG [offset] // long in segment CS is addressed
CSFLOAT [offset] // float in segment CS is addressed
// addressing in stack segment
SSBYTE [offset] // byte in segment SS is addressed
SSWORD [offset] // word in segment SS is addressed
SSCHAR [offset] // char in segment SS is addressed
SSINT [offset] // int in segment SS is addressed
SSDWORD [offset] // dword in segment SS is addressed
SSLONG [offset] // long in segment SS is addressed
SSFLOAT [offset] // float in segment SS is addressed
// addressing in additional data segment
ESBYTE [offset] // byte in segment ES is addressed
ESWORD [offset] // word in segment ES is addressed
ESCHAR [offset] // char in segment ES is addressed
ESINT [offset] // int in segment ES is addressed
ESDWORD [offset] // dword in segment ES is addressed
ESLONG [offset] // long in segment ES is addressed
ESFLOAT [offset] // float in segment ES is addressed
// addressing in additional segment 2 (80386) +
FSBYTE [offset] // byte in segment FS is addressed
FSWORD [offset] // word in segment FS is addressed
FSCHAR [offset] // char in segment FS is addressed
FSINT [offset] // int in segment FS is addressed
FSDWORD [offset] // dword in segment FS is addressed
FSLONG [offset] // long in segment FS is addressed
FSFLOAT [offset] // float in segment FS is addressed
// addressing in additional segment 3 (80386) +
GSBYTE [offset] // byte in segment GS is addressed
GSWORD [offset] // word in segment GS is addressed
GSCHAR [offset] // char in segment GS is addressed
GSINT [offset] // int in segment GS is addressed
GSDWORD [offset] // dword in segment GS is addressed
GSLONG [offset] // long in segment GS is addressed
GSFLOAT [offset] // float in segment GS is addressed
Example:
Load in AL byte from cell with hexadecimal address 0000:0417
ES = 0x0000;
AL = ESBYTE [0x417];
Move word from cell with hexadecimal address 2233:4455
to cell with hexadecimal address A000:0002
$PUSH DS
DS = 0x2233;
ES = 0xA000;
ESWORD [0x0002] = DSWORD [0x4455];
$POP DS
Save calculated value of expression X + 2 of type 'int' to cell with
hexadecimal address FFFF:1234
ES = 0xFFFF;
ESINT [0x1234] = X + 2;
Save BX in segment of stack with offset 42:
SSWORD [42] = BX;