61
Using NASM / Re: windows x86 64bit help
« Last post by hockey97 on August 30, 2024, 01:43:27 AM »I understood..
I am asking how to use LD the linker to link the ms-ABI for 64 bits.
I used this batch commands:
This works. The asm program is 32bits and this works perfectly.
If I change the -fwin32 to -fwin64 and -m32 to m-64 the ld part won't work. It would show an error that this isn't an i386 image it would complain because
the ld is using 32bit I change the directory to the 64 bit dlls in windows and still get that same error.
my point is how do you link the files properly for a 64bit program. I know the windows api is the same winmain is the same regardless if you use asm, c++, python, any programming language
and regardless if it's 32 bit system 64bit system or a 128 bit system the api stays the same.
my point is the why you link and assemble the program needs to be 32 bit if you're coding a 32 program and a 64bit if the program is supposed to be for a 64bit system.
I already know how to do this for 32bit systems. i am asking how to do this for 64 bit systems. There's nothing online about it.
Most say you don't need flags or arguments if the GCC and LD version you downloaded is 64bits. You just need the flags /. arguments if you want to make a 32bit version of the program you want for backwards capability purposes.
I am just asking how to assemble and link the files properly for GCC.
I am asking how to use LD the linker to link the ms-ABI for 64 bits.
I used this batch commands:
Code: [Select]
cd "$(CURRENT_DIRECTORY)"
nasm -fwin32 $(FILE_NAME) -o $(NAME_PART).o
ld -mi386pe $(NAME_PART).o C:\Windows\SysWOW64\user32.dll
ld -mi386pe $(NAME_PART).o C:\Windows\SysWOW64\Kernel32.dll
gcc -m32 $(NAME_PART).o -o $(NAME_PART).exe
$(NAME_PART).exe
This works. The asm program is 32bits and this works perfectly.
If I change the -fwin32 to -fwin64 and -m32 to m-64 the ld part won't work. It would show an error that this isn't an i386 image it would complain because
the ld is using 32bit I change the directory to the 64 bit dlls in windows and still get that same error.
my point is how do you link the files properly for a 64bit program. I know the windows api is the same winmain is the same regardless if you use asm, c++, python, any programming language
and regardless if it's 32 bit system 64bit system or a 128 bit system the api stays the same.
my point is the why you link and assemble the program needs to be 32 bit if you're coding a 32 program and a 64bit if the program is supposed to be for a 64bit system.
I already know how to do this for 32bit systems. i am asking how to do this for 64 bit systems. There's nothing online about it.
Most say you don't need flags or arguments if the GCC and LD version you downloaded is 64bits. You just need the flags /. arguments if you want to make a 32bit version of the program you want for backwards capability purposes.
I am just asking how to assemble and link the files properly for GCC.