I'm assuming that you'll be declaring the struct in your assembly code. According to the masm32 documentation you've got the following operators available to you:
LENGTHOF variable
SIZEOF variable
SIZEOF type
LENGTH expression
SIZE expression
Description
The LENGTHOF operator returns the number of data items allocated for <variable>. The SIZEOF operator returns the total number of bytes allocated for <variable> or the size of <type> in bytes. For variables, SIZEOF is equal to the value of LENGTHOF times the number of bytes in each element.
The LENGTH and SIZE operators are allowed for compatibility with previous versions of the assembler. When applied to a data label, the LENGTH operator returns the number of elements created by the DUP operator; otherwise it returns 1. When applied to a data label, the SIZE operator returns the number of bytes allocated by the first initializer at the <variable> label.
The LENGTHOF and SIZEOF operators in MASM 6.1 handle arrays much more consistently. These operators return the number of data items and the number of bytes in an initializer.
See masm32.chm in the masm32/help directory.
0
Quentin Rufin
On
MASM provides a SIZEOF keyword.
For a Point Structure like the following one:
Point STRUCT
x DWORD ?
y DWORD ?
Point ENDS
You can use SIZEOF like this.
SIZEOF Point
SIZEOF Point will be replaced by the number 8 in this example.
I'm assuming that you'll be declaring the struct in your assembly code.
According to the masm32 documentation you've got the following operators available to you:
See masm32.chm in the masm32/help directory.