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
Posted on 2003-11-15 13:41:53 by greenant
MsgHelp db 'Help String'
sizeofmsghelp equ $ - offset MsgHelp

is generally what i do in tasm
Posted on 2003-11-15 14:05:10 by evlncrn8
Isn't tasm supposed to be compatible with masm?
Posted on 2003-11-15 17:04:45 by Odyssey
depends on how you define 'compatible' ;)
Posted on 2003-11-15 19:13:26 by evlncrn8
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?
Posted on 2003-11-15 20:04:26 by Odyssey
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)

Posted on 2003-11-16 02:17:26 by greenant