SPRUI03E June 2015 – January 2023
The assembly built-in function $sizeof( ) can be used to query the size of a structure in assembly. It is an alias for the already existing $structsz( ). The syntax is:
$sizeof( structure name)
The $sizeof function can then be used similarly to the C built-in function sizeof( ).
The assembler's $sizeof( ) built-in function cannot be used to ask for the size of basic C/C++ types, such as $sizeof(int), because those basic type names are not represented in assembly. Only complex types are converted from C/C++ to assembly.
Also see Section 12.3.12, which notes that this conversion does not happen automatically if the C/C++ sizeof( ) built-in function is used within a macro.