SIZE Return bytes used by variable Operator
SIZE addr_name ; Ideal mode
Returns the actual number of bytes allocated to the data variable (DUP
byte count, if appropriate) if addr_name is defined in the current
module (i.e. the number of bytes occupied by the first item after
storage-allocation directives like DB or DW).
SIZE addr_name ; MASM mode
Returns the size of the subtype of addr_name
(UNKNOWN (0), BYTE (1), WORD (2), DWORD (4), PWORD (6), QWORD (8),
TBYTE (10d), SHORT = NEAR (0FFFFh), FAR (0FFFEh), structure_addr
= size of structure)
multiplied by the value of LENGTH addr_name.
Examples: theAuthor DB "Hemingway"
twoLines DB "Ln1",13,10,"Ln2"
Echoes DB 8 DUP ("Echo",13,10)
aSize = SIZE theAuthor ; Ideal 9, MASM 1
lSize = SIZE twoLines ; Ideal 3, MASM 1
eSize = SIZE echoes ; Ideal 6, MASM 8
aLen = LENGTH theAuthor ; Ideal 1, MASM 1
lLen = LENGTH twoLines ; Ideal 1, MASM 1
eLen = LENGTH echoes ; Ideal 8, MASM 8
SIZE struc_name/union_name/table_name ; Ideal or MASM mode
Returns the number of bytes required to represent the structure /
union / table.
SIZE struc/table_member_name ; MASM mode
Returns the quantity TYPE struc / table_member_name multiplied by
LENGTH struc / table_member_name.
SIZE record_name ; Ideal or MASM mode
Returns the number of bytes required to represent the total number of
bits reserved in the record definition: either 1,2, or 4.
SIZE enum_name ; Ideal or MASM mode
Returns the number of bytes required to represent the maximum value
present in the enum definition: either 1,2, or 4.
SIZE segment_name ; Ideal or MASM mode
Returns the size of the segment in bytes.
SIZE type_name ; Ideal or MASM mode
Returns the number of bytes required to represent the named type, with
short and near labels returning 0ffffh, and far labels returning 0fffeh.