flat assembler
Message board for the users of flat assembler.

Index > Main > In memory assembling - with fasm ?

Author
Thread Post new topic Reply to topic
tigujo



Joined: 07 May 2007
Posts: 9
Location: Vienna, Austria
tigujo
A wish:

I'd like to do the following:

1. I put some asm code (ASCII) somewhere in memory
[1.2 I reserve some other mem for my beloved (kochany) fasm to put its data there]

2. I call fasm (somehow) to take a look at the code (-> 1.) and assemble it into opcodes

3. fasm tells me, if it is okay, occasionally puts its binary output somewhere (into -> 1.2 maybe)

Or in short:
I'd like to have the option of a binary output - but without using files. Just mem.

Hmmm...I scanned all docs, couldn't find something like that, so I thought, it is not possible yet - talking about 'Windows', sorry....

What do you think of this "my wish"?

_________________
cheers,
tigujo
Post 07 May 2007, 01:54
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
tigujo wrote:
A wish:


I'd like to have the option of a binary output - but without using files. Just mem.

Hmmm...I scanned all docs, couldn't find something like that, so I thought, it is not possible yet - talking about 'Windows', sorry....

What do you think of this "my wish"?

It is possible if you do it,else wait for a long time.
I did it in 'octa os' but i'm not a windows programmer ,and Tomasz seems to be very busy these days.
Post 07 May 2007, 09:36
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
search board for "FASM DLL" or something like that. There was DLL with FASM somewhere recently
Post 07 May 2007, 09:51
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tigujo



Joined: 07 May 2007
Posts: 9
Location: Vienna, Austria
tigujo
Quote:

search board for "FASM DLL" or something like that. There was DLL with FASM somewhere recently


Thanks vid, I guess you had in mind:
http://board.flatassembler.net/topic.php?t=2917

Well, as it looks to me, as if the in-memory assembling feature still awaits to be manufactured... Wink
As a beginner I think it will take some time, until I found out how to do it right Smile

_________________
cheers,
tigujo
Post 07 May 2007, 14:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i think there was already some DLL version done. But i am not sure, and i am not even sure if it was assembling in memory or from file.

In-memory assembling might be a problem - what to do when you encounter "include"? To make such version, i would suggest to take FASM sources, include them into your project, and rewrite file reading / writing routines so that they read/write memory.
Post 07 May 2007, 14:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tigujo



Joined: 07 May 2007
Posts: 9
Location: Vienna, Austria
tigujo
Quote:

To make such version, i would suggest to take FASM sources


Yeah, that's what is left to be done...
I just thought, I could get along without understanding the source code of fasm Wink

Now, its time for digging into.

Thanks, vid. You did motivate me.

Regarding include:
I think of either the usual file-include by name, or "inventing" a new mem-include with some form of mem address supply (shared mem) or stream-include with some form of address - why not an URL?

We will see...

cheers,
tigujo
Post 07 May 2007, 14:46
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Regarding include:
I think of either the usual file-include by name, or "inventing" a new mem-include with some form of mem address supply (shared mem) or stream-include with some form of address - why not an URL?
depends on what you need. You can even completely disable "include" (and "file"), and make things easier.
Post 07 May 2007, 15:16
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
vid, you remembered correctly. The DLL version of fasm was posted here:
http://board.flatassembler.net/topic.php?t=6239
Post 07 May 2007, 22:20
View user's profile Send private message Visit poster's website Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden
I found the fasm.dll last week sometime and started to write a wrapper for it immediatly so i could intergrate assembly language into euphoria language ( I use it alot ) wich doe's not support asm syntax. The wrapper was wrote for the euphoria programming language but if anyone would like to port it or use pieces of it go ahead...

The latest version can be found here: http://www.rapideuphoria.com/fasmwrapper.zip

_________________
New User.. Hayden McKay.


Last edited by Hayden on 12 May 2007, 00:22; edited 2 times in total
Post 09 May 2007, 06:35
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Hayden: as for your problem with display pipe, see http://msdn2.microsoft.com/en-us/library/aa365780.aspx


Last edited by Tomasz Grysztar on 10 May 2007, 06:13; edited 1 time in total
Post 09 May 2007, 08:53
View user's profile Send private message Visit poster's website Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden
Thanks TG!
FASM Rocks!

_________________
New User.. Hayden McKay.
Post 10 May 2007, 00:47
View user's profile Send private message Reply with quote
tigujo



Joined: 07 May 2007
Posts: 9
Location: Vienna, Austria
tigujo
Quote:

The DLL version of fasm was posted here

Thanks a lot,
both vid for taking care of my question and Tomasz for having provided the solution - already.

_________________
cheers,
tigujo
Post 10 May 2007, 21:37
View user's profile Send private message Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden
Would it be easy enough to port the fasm.dll source to linux *.so format?
What steps would i need to take?
I'm definatly not a linux guru...

_________________
New User.. Hayden McKay.
Post 15 May 2007, 03:38
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Would it be easy enough to port the fasm.dll source to linux *.so format?

no, it would need very big rewrite Sad
Post 15 May 2007, 08:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden
vid wrote:
Quote:
Would it be easy enough to port the fasm.dll source to linux *.so format?

no, it would need very big rewrite Sad


bummer, my fasm wrapper is cross platform, but needs a fasm.so for linux, oh well...

<OT> just a note for anyone interested in useing my fasm.dll wrapper for euphoria in C. useing the E2C translator shipped with euphoria, my wrapper can be translated to watcom, borland, lcc or djgpp

_________________
New User.. Hayden McKay.
Post 16 May 2007, 08:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Hayden: why don't you link it statically? Code has only 64KB, not much these days
Post 16 May 2007, 10:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden
Thanks for the idea, that would probably work, but the problem is with linking it to euphoria, wich is an interpreted language. although I could probably to it without too much ado..., i'll look into it.

I would need to create a hybrid source wrapper, ie;

I would need to supply euphoria's cross platform routines, mixed in with modified pieces of flat assembler dll source...

_________________
New User.. Hayden McKay.
Post 21 May 2007, 04:13
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-2020, Tomasz Grysztar.

Powered by rwasa.