flat assembler
Message board for the users of flat assembler.

flat assembler > High Level Languages > Mixing FASM and MS Visual C

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Following is somewhat-advanced example of mixing assembly and C. It uses MS Visual C, but it may apply to other C compilers.

Only thing i am not sure about with other compilers is "__stdcall" declaration modifier. Someone could make gcc example of this and post it.


Description:
Download
Filename: msvc.zip
Filesize: 28.99 KB
Downloaded: 482 Time(s)



Last edited by vid on 14 Mar 2007, 10:44; edited 1 time in total
Post 15 Dec 2006, 18:05
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Remy Vincent



Joined: 16 Sep 2005
Posts: 155
Location: France
It's hard to separate printed value in asm from printed values in C...
And the code is so hard to follow... how can you work with 2 languages at the same time?? Have you two cars or have you two bycicles or something like that... it's amazing!!
Post 15 Dec 2006, 22:01
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Quote:
It's hard to separate printed value in asm from printed values in C
i understand it's little complicated. that's why i wrote "somewhat-advanced". For example some strings are defined in ASM code, passed to C function as argument, and printed from C functions. So string defined in ASM code gets printed by C code.

I just wanted to show all cases. There could be also simpler example, like just using asm procedure in C, or C procedure in ASM. This shows "everything"

Quote:
how can you work with 2 languages at the same time?

because both languages compile to same thing - x86 machine code. So these languages are just different ways to write down thing.
Post 15 Dec 2006, 22:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Remy Vincent



Joined: 16 Sep 2005
Posts: 155
Location: France
Once I tried something with a strange name "thunk" was the name, IT WAS A CALL between 16bitDLL and 32 bit program, and between 32bitDLL and 16 bit program,...

You can't imagine how stupid I WAS trying some trick that is so rarely used, and now, I still have my 16<==>32 try in mind, HALF-WORKING, and I can hardly look at your trick "messing" two different kind of codes,...

It's incredible that 10 years later I am still stuck with this old stuff I tried... ISWEAR I was about to learn quickly your trick just above, and then all I was reading about your stuff was VANISHING step after step, and the "memory" (souvenir in French) of my old "half working" work was disturbing my reading of your recent trick,... I think I need another life, because may be I will be never able to understand clearly your new trick just above,..

It's so hard to be "mentally" stuck with some old trick really hard and looking like your trick just above!!.

_________________
Groups lower your IQ
Post 16 Dec 2006, 21:08
View user's profile Send private message Visit poster's website 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-2019, Tomasz Grysztar.

Powered by rwasa.