NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: AttonRand on January 28, 2012, 04:21:30 PM
-
Hello guys!
I know i should write to M$ for this but i hope to get better support from you.
I am trying to set a learning environment with nasm in Windows. I use Notepad++ and Nppexec to speed up the compiling process. The problem is that everytime i try to compile any obj file i get:
fatal error LNK1107: invalid or corrupt file: cannot read at 0x225
different sources, same error.
I downloaded link.exe from WindowsDDK.
Commands that i use to compile and link are:
C:\NASM\nasm.exe -i C:\NASM\library\ -f obj C:\SOURCE\app.asm
C:\NASM\link.exe C:\SOURCE\app.obj C:\NASM\library\IO.OBJ /OUT:C:\SOURCE\app.exe
If anybody has some experience with this please tell me!
Thank you in advance.
EDIT: a source example that gives me problem can be found here hxxp://www.mediafire.com/?bcs5oyjqcel1kbm
-
There's an article that references that error number, which may or may not be relevant...
http://stackoverflow.com/questions/6346581/strange-vc-linker-error-lnk1107-that-references-link-exe
Nevermind. I just read your edit, and looked at the code. It is 16-bit code, and the linker you've got (I think) won't do 16-bit code. You'd think the error message might be more informative...
For 16-bit code, you need a 16-bit linker. MS's is available here:
ftp://ftp.microsoft.com/Softlib/MSLFILES/LNK563.EXE
Or... you could use Alink (which will do both 16- and 32-bit code):
http://alink.sourceforge.net/
I think that'll solve your problem.
Answer a question for me, if you would: what's "Nppexec"? I don't think I've ever heard of that one.
Best,
Frank
-
You are right! Thank you i thought that newer link.exe can support 16bit aswell but i was wrong.
As for nppexec, it's a plugin for notepad++ to do some automatic tasks for the command line.
Say you have to type everytime:
C:\NASM\nasm.exe -i C:\NASM\library\ -f obj C:\SOURCE\app.asm
C:\NASM\link.exe C:\SOURCE\app.obj C:\NASM\library\IO.OBJ /OUT:C:\SOURCE\app.exe
now you can create some scripts that will do the same for every nasm source (you can compile from notepad++ by pressing f6):
NPP_SAVE
C:\NASM\nasm.exe -i C:\NASM\library\ -f obj $(FULL_CURRENT_PATH)
C:\NASM\link.exe $(CURRENT_DIRECTORY)\$(NAME_PART).obj C:\NASM\library\IO.OBJ /OUT:$(CURRENT_DIRECTORY)\$(NAME_PART).exe
you can find more in the help file that comes with the install. just grab notepad++ and use the plugin manager to download it.
Thank you for your fast reply.
-
Ah! Thank you for your fast reply, too. Nppexec sounds pretty cool. I've been running Linux for some time now, so have to use "other methods" to do similar things. That's a good one to know, for the Windows folk!
Best,
Frank