flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > FASM as DLL

Author
Thread Post new topic Reply to topic
dixong



Joined: 26 Apr 2006
Posts: 2
dixong 26 Apr 2006, 15:29
Hi,
I'm writing a high level interpreter (Windows, but eventually others) in FASM and would like to be able to invoke FASM as a DLL from the interpreter for inline assembly. Nothing fancy--even something as simple as sending the DLL a single line (without unresolved variables) and getting the assembly code back.
Anyone done anything like this, or could anyone give hints as to how to proceed?
Thanks,
Glenn Dixon
Post 26 Apr 2006, 15:29
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 26 Apr 2006, 15:31
wouldn't it be better statically linked? is there any reason to use DLL?
Post 26 Apr 2006, 15:31
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dixong



Joined: 26 Apr 2006
Posts: 2
dixong 26 Apr 2006, 15:39
Thanks for your reply.
The interpreter is a language itself and you can write executable code in it.

Something like Forth. Inline assembly would be used to write routines that need to be either time or space efficient. They generally would be very short and simple subroutines, and you would write and execute them "on-the-fly" without compiling the entire application again.


Thanks,
Glenn
Post 26 Apr 2006, 15:39
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 26 Apr 2006, 15:52
yes, but i mean you can compile FASM into linkable file and then link it into your executable. you don't need another file (FASM.DLL).
Post 26 Apr 2006, 15:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don 17 May 2006, 17:19
dixong, I think this is a nice idea. It could be very useful for learning fasm in classroom style environment. Also useful to have fasm as scripting option at runtime in game or whatever project.

One can make GUI for it to assist the learner execute the fasm code he/she wrote on the spot. It's bring back the memory of using DBase or Foxpro. It does help to speed up the learning process.

The other benefits is the DLL being used as FASM framework. Located far away at a server computer and call-able by client PC thats connected to the servers. Something like an Enterprise version of FASM runtime DLL.

I wonder if this can be done, later-on, has anyone thought of making an ActiveX or COM version of FASM DLL?

i.e. in HLL (basic) calls:
Code:
MyObj.QueryInterface(IID_FASM, @lpFasm)
lpFasm.Execute(@MyAsmString) 'MyAsmString contain multiple 
                             'lines of inline FASM codes
lpFasm.Release
    
Post 17 May 2006, 17:19
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY 10 Oct 2006, 22:24
I think a DLL version for FASM would be great!
I agree with i-don!
Post 10 Oct 2006, 22:24
View user's profile Send private message Reply with quote
llaurrentt



Joined: 02 Nov 2006
Posts: 13
Location: Liège / Belgium
llaurrentt 04 Nov 2006, 10:58
dixong wrote:
Hi,
I'm writing a high level interpreter (Windows, but eventually others) in FASM and would like to be able to invoke FASM as a DLL from the interpreter for inline assembly. Nothing fancy--even something as simple as sending the DLL a single line (without unresolved variables) and getting the assembly code back.
Anyone done anything like this, or could anyone give hints as to how to proceed?
Thanks,
Glenn Dixon


Unless you need an immediate binary return of the line assembled (don't forget FASM is multi-pass), why don't you simply use redirection and launch it as a child process?
Post 04 Nov 2006, 10:58
View user's profile Send private message MSN Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware 05 Nov 2006, 04:11
llaurrentt wrote:

Unless you need an immediate binary return of the line assembled (don't forget FASM is multi-pass), why don't you simply use redirection and launch it as a child process?

That's actually how Reva currently integrates assembly... it uses FASM in precisely that manner if desired.
Post 05 Nov 2006, 04:11
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla 19 Jun 2007, 08:24
ronware wrote:
llaurrentt wrote:

Unless you need an immediate binary return of the line assembled (don't forget FASM is multi-pass), why don't you simply use redirection and launch it as a child process?

That's actually how Reva currently integrates assembly... it uses FASM in precisely that manner if desired.

Or you can simply generate a FASM output and call FASM like this:

FASM.EXE "~ABCDEF~.TMP" "ABCDEF.EXE"

I also have heard that FASM can produce *.OBJ files, I'm not sure about that one though as I have never needed to use a *.OBJ in an assembly-language project (operating system) before.
Post 19 Jun 2007, 08:24
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 24 Dec 2007, 15:53
There is actually a FASM dll library, it is attached in the Windows section thread of "fasm.dll" or something from about a week or so ago. Should work great if this poject is still going lol.
Post 24 Dec 2007, 15:53
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.