Using x64 NASM ASM with MSVC2008 x64

Place to talk about all that new hardware and decaying software you have.

Moderator: General Mods

Post Reply
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Using x64 NASM ASM with MSVC2008 x64

Post by mudlord »

Okay, I ran into a problem. Win95-XP 32bit version is fine, Vista/Win7 x64 version has major issues with NASM.

My commandline for NASM is this:
nasm.exe -f win64 "$(InputName).asm" -o "$(InputName).obj" -s -O9
Output is:
$(InputName).obj

Resulting error is:
"unresolved external symbol (blahblah in function blahblah"

I am importing a huge amount of binary data using x64 ASM to simplify things. Amounting to around 324KB. Imported using "incbin" in NASM. All data goes in the .data section, I did not use a seperate section for the bin data.

I used

Code: Select all

extern "C" {
		extern DWORD somedata;
		extern DWORD somedata_LENGTH;
}
in MSVC to define the data. Again, works great in Win32, fails compilation in x64. And BTW, thats the only compile error. Everything else works fine.

Help is appreciated.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: Using x64 NASM ASM with MSVC2008 x64

Post by grinvader »

mudlord wrote:Resulting error is:
"unresolved external symbol (blahblah in function blahblah"
I assume starting there would be a good point.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
mudlord
has wat u liek
Posts: 559
Joined: Tue Sep 11, 2007 2:54 pm
Location: Banland.

Post by mudlord »

Thanks Grin, that was the pointer I needed.

Seems some certain things were done a little bit differently compared to the 32-bit version, like how data chunks are defined in x64 ASM.
Fixing my x64 ASM source files to comply with the changes fixed the issue.
Post Reply