You cannot use the built-in compilers because they are handled by the Delphi compiler, not by assembler. Intrinsics are resolved by Pascal compiler processing and parse Pascal expressions and then emit code. This is the task of the compiler, not the collector. At least this is my mental model.
In the case of SizeOf you need to use the type expression operator:
add eax, type NativeInt
Or really:
function Test: integer; asm mov eax, type NativeInt end;
This function performs as you expect.
The documentation is here: Assembly expressions, Expression operators .
And yes, the fact that your code compiler should be considered a bug.
David heffernan
source share