How to enable NASM in Dev-C++?

Programming, for all ages and all languages.
Post Reply
raywill

How to enable NASM in Dev-C++?

Post by raywill »

How to enable NASM in Dev-C++?

It give me such Link error:
[Linker error] undefined reference to `setvect'

In my project , setvect is defined in the asm file .
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to enable NASM in Dev-C++?

Post by Pype.Clicker »

if you can locate something like "do not prepend underscore to symbol names", click it.

otherwise, try renaming "setvect" in "_setvect" in the asm file: MS-* platforms traditionally prepend an underscore to every C-generated symbol, and thus equivalently to extern (unresolved) symbols that you'll write in assembly.

An objdump-like tool should confirm you the symbol tables from the C/C++ part expects _setvect instead of setvect.

Of, make sure you've declared it as a "C" stuff too, or name mangling will be trying to translate it into something like __v7setvectiie or whatever the MS name mangling policy will find appropriate.
raywill

Re:How to enable NASM in Dev-C++?

Post by raywill »

Pype.Clicker wrote: if you can locate something like "do not prepend underscore to symbol names", click it.

otherwise, try renaming "setvect" in "_setvect" in the asm file: MS-* platforms traditionally prepend an underscore to every C-generated symbol, and thus equivalently to extern (unresolved) symbols that you'll write in assembly.
Oh,sorry.I haven't make the problem clear to you.
I meant to say all functions written in asm can't be found.
To be more clear, I can find any myasm.o file after compiling.

So,I think that's because I haven't set the enviroment for asm correctly.
The question may be changed to "how to let Dev-C++ support ASM?"
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:How to enable NASM in Dev-C++?

Post by kataklinger »

Did you mark symbols which you want to export from ASM sa [global]?
raywill

Re:How to enable NASM in Dev-C++?

Post by raywill »

kataklinger wrote: Did you mark symbols which you want to export from ASM sa [global]?
Yes.
Phugoid

Re:How to enable NASM in Dev-C++?

Post by Phugoid »

I think the question is more about how to cause Dev-C++ to invoke the assembler. I can't help with Dev-C++, though.
raywill

Re:How to enable NASM in Dev-C++?

Post by raywill »

Phugoid wrote: I think the question is more about how to cause Dev-C++ to invoke the assembler. I can't help with Dev-C++, though.
Quite exactly.
Can anyone help?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to enable NASM in Dev-C++?

Post by Pype.Clicker »

google seems to have interesting pointers ...

Otherwise, that's more a matter of digging your dev-c++ manuals than a matter of OS development knowledge.
Post Reply