flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > compile directive (or assemble, or anything). Goto page 1, 2 Next |
comile directive | |||||||||||||||||||||
|
|||||||||||||||||||||
Total Votes : 13 |
Author |
|
HaHaAnonymous 21 Oct 2013, 17:42
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:40; edited 2 times in total |
|||
21 Oct 2013, 17:42 |
|
edfed 21 Oct 2013, 17:55
it is not an example, it is a request about the fasm compiler internals. the associated example is just to imagine the possibilities.
|
|||
21 Oct 2013, 17:55 |
|
shutdownall 21 Oct 2013, 20:56
Isn't it mainly that stuff what a linker does ?
Could be realized with batch files or with eclipse or with an own application using FASM.DLL as compiler engine. |
|||
21 Oct 2013, 20:56 |
|
revolution 22 Oct 2013, 00:34
fasm is not a batch file interpreter, or a "make" facility. Just keep it simple and single purpose, we have other tools to automate multiple tasks (batch files and make programs).
|
|||
22 Oct 2013, 00:34 |
|
edfed 22 Oct 2013, 10:10
it can also let compile a dll needed by an executable, without using boring platform specific batch or make files.
|
|||
22 Oct 2013, 10:10 |
|
edfed 22 Oct 2013, 16:45
for example:
using the dll example from fasmw package Code: compile "errormsg.asm";compile the dll format PE GUI 4.0 entry start include 'win32a.inc' section '.text' code readable executable start: invoke ShowLastError,HWND_DESKTOP invoke ExitProcess,0 section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ errormsg,'ERRORMSG.DLL' import kernel,\ ExitProcess,'ExitProcess' import errormsg,\ ShowLastError,'ShowLastError' and the dll file will be compiled just before the program using it, and run with just one hit on the F9 key |
|||
22 Oct 2013, 16:45 |
|
cod3b453 22 Oct 2013, 17:52
At first glance, this suits my lazy side nicely but the examples are not reflective of all huge projects. It is possible to have a large include tree that has requirements on a particular file that is used in many places; with this simple behavior it would be very inefficient to rebuild the same file. As soon as you add other keywords to get around this and other problems, it becomes more complex and ultimately requires prior knowledge of the surrounding build stages.
There are also still the same issues related to type of build (win/unix), since there's no way to indicate the target platform without an external build action (and if there were you'd need to perform external stages for C/... building). Ultimately this still ends up needing the likes of CMake/Python/Perl/... or shell/batch/make/... scripts, so I think it makes sense to use them rather than confuse source and build. |
|||
22 Oct 2013, 17:52 |
|
edfed 21 Nov 2013, 15:42
ok, then, i will make it for me only, using the ShellExecute("fasm.exe","file.asm file.exe") function of course.
i saw the directives are in tables.inc and used somewhere else to call the related function. i think no more than 20 extra lines are needed in various places of the code. |
|||
21 Nov 2013, 15:42 |
|
edfed 28 Jan 2014, 10:27
It doesn't only brings the possibility to improve our laziness, it also let us imagine many cool and usefull usage of fasm as a pure and universal development tool, depending on what macros are defined, and it will let you generate many files.
another feature would be to generate multiple files from only one source file. compile "file.asm" would be very cool, but a sort of compile container would be far more interresting. compile "file.bin" { blablabla } this second featurewould be very hard to implement. |
|||
28 Jan 2014, 10:27 |
|
revolution 28 Jan 2014, 10:36
You could use fasm.dll to do the compilation and just have wrapper code to extract out the "compile" directives. Although care must be taken with the dll since it doesn't support multiple threads so only one section can be compiled at a time.
|
|||
28 Jan 2014, 10:36 |
|
edfed 29 Jan 2014, 10:22
hem, in fact, only a sort of compile block could be interresting cause it can cover all usecases
Code: compile "file.bin" {;create a binary file from another source code include "file.asm" } compile "file1.bin" {;create a binary file from code mov eax,ebx } myfile = "file2.bin" compile myfile {;create an empty binary file } |
|||
29 Jan 2014, 10:22 |
|
revolution 29 Jan 2014, 13:41
edfed wrote: hem, in fact, only a sort of compile block could be interresting cause it can cover all usecases |
|||
29 Jan 2014, 13:41 |
|
sid123 29 Jan 2014, 14:31
I would like the compile keyword, but it would be nice to make the compile keyword tell FASM to incbin it.
Which means: The compile keyword will compile the program, like LOL.ASM to LOL.BIN and add this during compilation, Code: file 'LOL.BIN' This would help us have two ORGs in one program without specifically compiling each part. Else than that as others said it would become a Makefile mess, I hate GNU,C and Make for that reason which makes me get faith in MS VB and C#. |
|||
29 Jan 2014, 14:31 |
|
Tomasz Grysztar 29 Jan 2014, 14:46
sid123 wrote: This would help us have two ORGs in one program without specifically compiling each part. |
|||
29 Jan 2014, 14:46 |
|
shutdownall 30 Jan 2014, 00:06
Tomasz Grysztar wrote: Why not have multiple modules in source, each with its own ORG / adressing space setup? I don't know either what he meant. I use ORG sometimes extensively and added PHASE and DEPHASE directives in FASM as used in some older assemblers for compatibility. These commands can be cascaded and I use an internal address stack for that. Quote: org 9000h http://members.shaw.ca/gp2000/zmac.html http://www.xl2s.tk |
|||
30 Jan 2014, 00:06 |
|
edfed 30 Jan 2014, 09:13
yep, it looks a lot like a sort of batch or make file.
but at least, this will be a makefile with a far more power than any other batch/makefile ever designed before, and can lead fasm to become an universal tool (it is still an universal assembler) i also have a project for fasm/os. using fasm as a shell in my future os (when i will have it working, just after having it in progress, just after having it out of the project box... ) |
|||
30 Jan 2014, 09:13 |
|
badc0de02 01 Apr 2014, 15:19
edfed,
edfed wrote:
why you not make: Code: include "kernel.asm" BROWSER: include "browser.asm" |
|||
01 Apr 2014, 15:19 |
|
badc0de02 01 Apr 2014, 16:10
edfed wrote:
why not you use Code: virtual at 0 ;offset ; code ... end virtual |
|||
01 Apr 2014, 16:10 |
|
badc0de02 01 Apr 2014, 16:18
Quote:
without specific gates our processor will not work. |
|||
01 Apr 2014, 16:18 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.