MsgHelp db 'Help String'
With masm I can use sizeof to retrieve the lenght of a variable
Eg: sizeof MsgHelp would return 11
But with TASM? Is there a similar keyword?
Size and Lenght doesn't work for me
MsgHelp db 'Help String'
sizeofmsghelp equ $ - offset MsgHelp
is generally what i do in tasm
sizeofmsghelp equ $ - offset MsgHelp
is generally what i do in tasm
Isn't tasm supposed to be compatible with masm?
depends on how you define 'compatible' ;)
LOL well thats what I hear :grin:. There's the masm compatibility mode and ideal mode. What exactly does the size and length operators in tasm do?
Tasm is supposed to be compatible with masm, but the earlier version of masm didn't have sizeof keyword
LENGTH Return Length of Item
LENGTH variable
Returns the number of BYTE, WORD, DWORD, QWORD, or TBYTE items
occupied by variable.
Notes: The type of the variable determines what element size is
used.
The value returned by this value is the number preceding
the DUP operator in the variable definition. Therefore,
only variables defined using the DUP operator will
return values greater than 1. String constants will
allows return 1.
SIZE Return Bytes Used by Variable
SIZE variable
Returns the number of bytes occupied by variable.
Notes: The value returned by this operator is equal to the
LENGTH of variable times the TYPE of variable. That is:
SIZE variable = (LENGTH variable) * (TYPE variable)
LENGTH Return Length of Item
LENGTH variable
Returns the number of BYTE, WORD, DWORD, QWORD, or TBYTE items
occupied by variable.
Notes: The type of the variable determines what element size is
used.
The value returned by this value is the number preceding
the DUP operator in the variable definition. Therefore,
only variables defined using the DUP operator will
return values greater than 1. String constants will
allows return 1.
SIZE Return Bytes Used by Variable
SIZE variable
Returns the number of bytes occupied by variable.
Notes: The value returned by this operator is equal to the
LENGTH of variable times the TYPE of variable. That is:
SIZE variable = (LENGTH variable) * (TYPE variable)