flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
kamac 12 Dec 2013, 19:28
Hey there.
I've got a question about extrn. Why do I seem to have to use: extrn myFunc rather than: extrn 'myFunc' as myFunc:dword When I'm combining two FASM-generated .obj files? I must extern all other functions that seem to come from .a libraries with the 2nd convention, and those that come from .obj files with 1st convention? Is there a way to change that? Btw. I'm compiling with format MS COFF. @EDIT Actually, it does work, but I must call the function this way: call exportedFunc rather than this: call [exportedFunc] Well, I guess it's mean to be this way. Though, if anybody knows a way to force the call to include [ ], I'd appreciate it. @EDIT2 Same goes for FASM-generated .a libs. Consider this example: Code: format MS COFF extrn '__imp__printf' as printf:dword section '.text' code customFunc: push dbg call [printf] add esp,4 ret Then, I generate an .obj file by: FASM customFunc.asm customFunc.obj Then, I generate an .a file: ar rcs libcustomfunc.a customFunc.obj Then, I must do this to make it work: Code: format MS COFF extrn 'customFunc' as customFunc:dword section '.text' code _start: call customFunc ret Why is that? Why do I have to call printf by using the [ ], and I mustn't use them with my own function taken from shared library? @nEDIT Okay, I read this topic: http://board.flatassembler.net/topic.php?p=108519 And now I kinda understand.. But is there any way for me to declare extern printf and call it without the brackets? Like: extrn '__imp__printf' as printf:dword ; ... call printf ? Cheers. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.