flat assembler
Message board for the users of flat assembler.
Index
> Main > Fasm JIT Compilation |
Author |
|
crc 26 Nov 2004, 10:38
I'd tend to think that it would be better to have a DLL containing FASM. You'd build the source for FASM to assemble in memory, pass the address of that buffer, and then load the resulting code in whatever way seems best (as a DLL, exe, or from another memory buffer). That should be faster than creating a .txt on disk and encountering the load times of FASM whenever you wanted to jit compile something.
|
|||
26 Nov 2004, 10:38 |
|
MattBro 26 Nov 2004, 18:39
That's not a bad idea. Your suggestion would require a modification to the fasm compiler to run as a called subroutine I think. However, one thought along these lines, would be to create a disk partition in memory and use the fasm compiler as is, reading and writing files to the memory mapped partition.
I also seem to recall another thread somewhere that discussed the idea of running the compiler as a subroutine. I'll have to dig up that link to see if anyone has done anything in this area. |
|||
26 Nov 2004, 18:39 |
|
fasm9 26 Nov 2004, 20:14
similar project is there, though, dunno if it works for FASM.
you have to have familiar with c++. gnu lightning 1.2 (2004-11-25) http://www.gnu.org/software/lightning/lightning.html -- |
|||
26 Nov 2004, 20:14 |
|
MattBro 26 Nov 2004, 22:03
Thanks for the post fasm9; its an interesting project. I would love to use it, however the license is a bit restrictive. I want to release my project under a license that allows commercial use.
I am also looking at this little project http://mitglied.lycos.de/cschueler/asm/download.html |
|||
26 Nov 2004, 22:03 |
|
Octavio 26 Nov 2004, 22:15
MattBro wrote: That's not a bad idea. Your suggestion would require a modification to the fasm compiler to run as a called subroutine I think. However, one thought along these lines, would be to create a disk partition in memory and use the fasm compiler as is, reading and writing files to the memory mapped partition. You don´t need a ram disk, just modify fasm read and write routines to read from the memory area where the source is and write to a memory area to execute the program, the program should be in plain binary format to be ready to execute and call directly the code of the interpreter, not the OS,else you have to write some executable loader-linker. I wrote a assembler called 'octasm' for dos, and this assembler can be used as a interpreter, and i think that there are some others too. many assemblers are listed here: http://www.retroforth.org/asmchart/ |
|||
26 Nov 2004, 22:15 |
|
MattBro 26 Nov 2004, 23:55
Quote: You don´t need a ram disk, just modify fasm read and write routines to read from the memory area where the source is and write to a memory area to execute the program, the program should be in plain binary format to be ready to execute and call directly the code of the interpreter, not the OS,else you have to write some executable loader-linker. Is it really that simple Octavio? I imagine that fasm must write some kind of header to it's .exe and .dll output files to make the code relocatable and loadable by the operating system. Your proposal requires that this header be bypassed I believe. Although external references can be supplied at compile time, there is also the issue of internal references, which, in some cases, can only be resolved after multiple passes. Moreover fasm will resolve internal refernces in such a way so as to make the code loadable by the operating system. I guess the point here is that fasm doesn't generate raw executable code; (unless it has features I don't know about) it generates operating system relocatable code, with all it's required headers and conventions. The end result of this path is the need to have a routine that can load .exe or .dll formatted binaries already in memory into my interpreter. That's basically an OS operation. To make fasm generate code that can be executed without operating system intervention sounds like a more involved operation that simply changing the read and write subroutines, unless I am somehow missing your point. _________________ -- ------------------------------------------------------- "I am the Way and the Truth and the Light, no one comes to the Father except through me" - Jesus --------------------------------------------------------- |
|||
26 Nov 2004, 23:55 |
|
Octavio 27 Nov 2004, 12:04
yes, fasm can generate raw code and data read a bit more about it.
|
|||
27 Nov 2004, 12:04 |
|
MattBro 27 Nov 2004, 18:28
OK yes, thanks Octavio, you are right. I just noticed the format binary directive. That makes your suggestion a possibility. I'll have to play around with it to see how it works.
Apparently you can also set the address at which the code will appear in memory using the org directive. Thats very cool and should hopefully resolve the issue about how internal labels are handled,. |
|||
27 Nov 2004, 18:28 |
|
penang 28 Nov 2004, 14:31
[quote="MattBro"]
Thanks for the post fasm9; its an interesting project. I would love to use it, however the license is a bit restrictive. I want to release my project under a license that allows commercial use. [/quote] I don't think the license bans you from using it commercially. All it says is whatever changes you do to the original code, you contribute it back to the project. |
|||
28 Nov 2004, 14:31 |
|
MattBro 28 Nov 2004, 19:00
Alas, the problem for most commercial use of such a library is clause 6 of the GNU lesser public license. As I read it, it requires that all source be distributed with any programs that link to the library. Now I actually intend to distribute my source freely once it's mature enough, however if I used lightning, other users of my code (if there are any) would be constrained by this license, likely making it a non-starter for most types of commercial distribution.
Many 'free' compilers such as OCAML for example, distribute their software with the same license, but with a clause 6 exemption. I am enclosing the license so you can see it for yourself. This is the license file I downloaded from the lightning package.
|
|||||||||||
28 Nov 2004, 19:00 |
|
fasm9 02 Dec 2004, 21:43
try to contact the author, or gnu ppl. all we need is talk, meeting, conversation.
i think "commercial use" is one thing, "open source" is another thing. so open source with commercial use is possible, imho. -- of course, this is my view of GLGPL. |
|||
02 Dec 2004, 21:43 |
|
trullyblessed 13 Feb 2005, 22:50
For Octavio
"I wrote a assembler called 'octasm' for dos, and this assembler can be used as a interpreter," We have this assembler. We are using it on an in house project and would like to know if there is any thing else available on it? Royce _________________ royce |
|||
13 Feb 2005, 22:50 |
|
Octavio 14 Feb 2005, 02:51
trullyblessed wrote: For Octavio You are the first octasm user i have notice so don´t expect to find very much. i have a os writen in octasm on my web page, it has about 400kb of source code. the octasm version that comes with my os is more updated than the old dos version ,but only works on my os. |
|||
14 Feb 2005, 02:51 |
|
trullyblessed 14 Feb 2005, 04:41
You are the first octasm user i have notice
so don´t expect to find very much. i have a os writen in octasm on my web page, it has about 400kb of source code. the octasm version that comes with my os is more updated than the old dos version ,but only works on my os.[ We like it for many reasons. We e-mailed you after we left our post, didn't expect a reply here so soon. Why does it only work with your O/S? [/quote] _________________ royce |
|||
14 Feb 2005, 04:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.