Re: Problem Linking (win32)



On Jul 23, 9:15 am, "Jim Carlock" <spamt...@xxxxxxxxxx> wrote:


Thanks for posting that, Frank. That helps, as I noticed that the
nasm32.inc encodes the following which demonstrates that you're
correct (I did not see Brian using an %include for that file):

I am not including any macros in my file. I'm using the latest
version
of nasm and the latest version of golink. I want to feel out NASM
some
more before I start to use macros. I'm just following the NASM manual
for the sections for win32 coff.

A consistent error occurs upon the loading of my asm. No error occurs
at loading if I leave out functions that link back to msvcrt.dll. I'm
not sure if this is a linking problem or a loading problem or
something else.
I do know that I do not have this problem when building with alink
and
OMF files.

Here's another example. This example results in this error being set
upon loading:

ERROR_ENVVAR_NOT_FOUND (000000CB)

And this happens every time. Check out the value of eax after
GetLastError is called. This could just be an issue with MS's loader
on xp.

;nasm -f win32 atext.asm
;golink /console atext.obj kernel32.dll user32.dll msvcrt.dll

extern printf
extern ExitProcess
extern GetLastError

section .text text CLASS=TEXT

global start
start:

call [GetLastError]

push dword sText
call printf
add esp, 4

push dword 0
call [ExitProcess]

section .data data CLASS=DATA

sText dd "Test", 0

Any ideas? Can you reproduce my error on your machines?


.



Relevant Pages

  • Re: Problem Linking (win32)
    ... version of nasm and the latest version of golink. ... extern MessageBoxA ... your application to compile, link and run. ... A consistent error occurs upon the loading of my asm. ...
    (comp.lang.asm.x86)
  • Re: Problem Linking (win32)
    ... at loading if I leave out functions that link back to msvcrt.dll. ... I wouldn't "expect" GetLastError to persist from one program to another, ... extern ExitProcess ... I could easily access a machine running Windows, but I'm trying to help MicroSoft avoid becoming a "monopoly"... ...
    (comp.lang.asm.x86)
  • Re: Windows Assembly
    ... >global function or variable, you have to type a "global" for it in the ... >can't just make one file to include in all of the others, because NASM ... >gets mad if you "extern" something that's not external. ... proc myproc ...
    (alt.lang.asm)
  • Re: NASM HelloWorld - DOS
    ... the ExitProcess function from kernel32. ... going through the INVOKE macro... ... EXTERN for each defined function in the include ... multiple externs, Nasm does not, and it bloats the executable slightly. ...
    (alt.lang.asm)
  • Re: Ann: Luxasm 00.01.00 (2004-04-08)
    ... > I will post some NASM examples in the next release then. ... Motif, lesstif... ... EXTERN gtk_window_new ... "I'll write my own license." ...
    (alt.lang.asm)