Hi all

I'm new to this forum and new to asm programming in general.

I am using nasm and alink to compile and link some code.

The linker is coming up with the following warnings:

Loading file testwindow.obj
matched Externs
matched ComDefs
Generating PE file testwindow.exe
Relocs 0:Warning 32 bit offset in 16 bit field
Relocs 2:Warning 32 bit offset in 16 bit field
Relocs 4:Warning 32 bit offset in 16 bit field
Relocs 12:Warning 32 bit offset in 16 bit field
Relocs 13:Warning 32 bit offset in 16 bit field
Relocs 26:Warning 32 bit offset in 16 bit field
Relocs 32:Warning 32 bit offset in 16 bit field
Warning, no entry point specified

When I run the executable I get an error message, "Exception privileged instruction" which I assume is as a result of these warnings.

I understand what the warnings mean, but how do I find what they relate to?  (i.e. where in the code)

Hoping you can help a n00b.

Wongdai
Posted on 2005-11-23 00:27:49 by WongDai
Hi WongDai,

Welcome on board.

I suggest you the MS linker supplied with Hutch's masm32 package, it's designed to use with ml.exe and MS C/C++ compilers. Also, MS link creates smaller executables compared to Alink.

Masm32 download sites :

http://www.masm32.com/masmdl.htm
Posted on 2005-11-23 04:59:03 by Vortex
WongDai, could you attach your .asm file and post the nasm and alink commandlines you use to produce the exe?

Using MS link.exe (or the free polink from PellesC, http://smorgasbordet.com/pellesc ) is a better choice than alink, since it hasn't been updated for ages and has a couple of bugs and limitations.
Posted on 2005-11-23 06:56:58 by f0dder

Welcome on board.


Thanks!


I suggest you the MS linker supplied with Hutch's masm32 package, it's designed to use with ml.exe and MS C/C++ compilers. Also, MS link creates smaller executables compared to Alink.

Masm32 download sites :

http://www.masm32.com/masmdl.htm


OK, I've done that.  It will take me some time to figure out which switches to use.

I tried just running lnk.bat against the obj file, but got some inscrutable error messages.

Will do some research.

Wongdai
Posted on 2005-11-23 18:50:37 by WongDai

WongDai, could you attach your .asm file and post the nasm and alink commandlines you use to produce the exe?


OK.  The .asm file is not mine btw.  I got if from somewhere but it didn't compile properly so I have made some changes to get it past nmakew.exe 

I don't think my changes are what is causing the issue however.  The command lines I am using are:
nasmw -fobj testwindow.asm
alink -c -oPE  -subsys gui testwindow

As I said this is a learning experience for me, so am keen to understand the problem rather than just resolve it.

Thanks for your help

Wongdai


Attachments:
Posted on 2005-11-23 18:59:23 by WongDai
WongDai,

try using nasm -f coff or nasm -f win32

ancev
Posted on 2005-11-23 21:22:05 by ancev

WongDai,

try using nasm -f coff or nasm -f win32

ancev



Thanks. Well I did that, and initially it nasmw borked badly on the IMPORT statements.  So, I removed these and it compiled fine. 

Linking was a different story however. Both alink and/or link complained about unresolved external references.

I wish I could get past this external reference thing and just get on with learning winasm!

I researched all day to work out how to get external references working with Link and Nasm, but I have not had any joy.  Decorated names, different names in dll, I tried them all but no luck.

Any ideas?

Wongdai
Posted on 2005-11-24 00:38:27 by WongDai
Hi

Should I just give up with nasm and move to masm instead?  It seems to be better supported.

Is the whole compilinng/linking/external reference thing easier with masm?

Wongdai
Posted on 2005-11-24 20:46:32 by WongDai
Should I just give up with nasm and move to masm instead?  It seems to be better supported.

Yes :) You should move to Masm. It has a huge tecnical support.

Is the whole compilinng/linking/external reference thing easier with masm?

Absolutely.
Posted on 2005-11-25 00:32:14 by Vortex