flat assembler
Message board for the users of flat assembler.

Index > Main > Fasm & static lib - the friendship is possible?

Author
Thread Post new topic Reply to topic
Aster!x



Joined: 16 Jul 2004
Posts: 26
Aster!x 10 Sep 2004, 18:28
subj
Post 10 Sep 2004, 18:28
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 10 Sep 2004, 19:21
Yes it is possible. You just need to create a coff obj file and use the extrn directive to tell fasm the external symbols you want to use. Here is an example thats uses masm32's user32.lib, linked with ms link.exe.

Code:
 
format MS COFF

        extrn '__imp__MessageBoxA@16' as MessageBox

section 'data' data readable writeable
        msg db 'hello world', 0

section '.text' code readable executable

        public _start
_start:
        push 0
        push msg
        push msg
        push 0
        call dword [MessageBox]

        ret 
    

_________________
silkodyssey
Post 10 Sep 2004, 19:21
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 11 Sep 2004, 08:08
Code:
format MS COFF
        extrn '__imp__MessageBoxA@16' as MessageBox

section 'data' data readable writeable
        msg db 'hello world', 0

section '.text' code readable executable

        public _start
_start:
        invoke dword [MessageBox],0,msg,msg,0 ;Isn't this supported when including
                                              ;some invoke macro in the
                                              ;beginning and why doesn't it
                                              ;know that MessageBox is dword?

        ret    

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 11 Sep 2004, 08:08
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Aster!x



Joined: 16 Jul 2004
Posts: 26
Aster!x 11 Sep 2004, 08:30
Thanks. I've understood Smile
Post 11 Sep 2004, 08:30
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 11 Sep 2004, 09:16
It should be:
Code:
extrn '__imp__MessageBoxA@16' as MessageBox:dword    
Post 11 Sep 2004, 09:16
View user's profile Send private message Visit poster's website Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 11 Sep 2004, 09:46

_________________
Code it... That's all...
Post 11 Sep 2004, 09:46
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 11 Sep 2004, 10:23
At last I am clear about this subject now Very Happy
Post 11 Sep 2004, 10:23
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
uri



Joined: 09 Apr 2004
Posts: 43
Location: L'viv, Ukraine
uri 13 Sep 2004, 09:15
Post 13 Sep 2004, 09:15
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Aster!x



Joined: 16 Jul 2004
Posts: 26
Aster!x 16 Sep 2004, 11:33
Can I cause some function from static library in fasm??
Post 16 Sep 2004, 11:33
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 16 Sep 2004, 23:12
Yes you can. That is what the examples in this thread demonstrate. But if you're having a problem someone here would be able to help you if you can provide more info.

_________________
silkodyssey
Post 16 Sep 2004, 23:12
View user's profile Send private message MSN Messenger Reply with quote
Aster!x



Joined: 16 Jul 2004
Posts: 26
Aster!x 17 Sep 2004, 00:45
Thank You, silkodyssey.
I have not understood first.
I thought that this example on how to create the static library from obj Smile
Post 17 Sep 2004, 00:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.