How to import a Unsigned Long (ULONG64) into x64 ASM File in Visual Studio 2019

156 Views Asked by At

OK so I'm using Visual Studio Community 2019 with MASM enabled and I'm trying to declare a variable in my ASM file that is defined outside of the .ASM file but in the same project. How can I do this ?

I've tried the following:

EXTERN MyVar:ULONG64

but Visual Studio gives me the following compile error:

Error   A2006   undefined symbol : ULONG64  TestDrv C:\Users\XFL\Documents\Visual Studio 2019\Projects\XFL\TestDrv\TestDrv\SwapSrc.asm  9
1

There are 1 best solutions below

0
jb_dk On

C and assembler are very different languages and everything is spelled differently. Assembler names all 64 bit types (including floating point doubles) QWORD, the C language and Windows headers use other names such as __int64, long long, etc.

Similarly assembler writes hexadecimal 64 bit numbers as 0123456789ABCDEFh while the C language writes it 0x0123456789ABCDEFui64 etc. etc.