flat assembler
Message board for the users of flat assembler.
![]() 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 |
|||
![]() |
|
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.
|
|||
![]() |
|
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. ![]() |
|||
![]() |
|
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).
|
|||
![]() |
|
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.
|
|||
![]() |
|
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 |
|||
![]() |
|
cod3b453 22 Oct 2013, 17:52
At first glance, this suits my lazy side nicely
![]() 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. |
|||
![]() |
|
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. ![]() |
|||
![]() |
|
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. |
|||
![]() |
|
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.
|
|||
![]() |
|
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 } |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
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#. |
|||
![]() |
|
Tomasz Grysztar 29 Jan 2014, 14:46
sid123 wrote: This would help us have two ORGs in one program without specifically compiling each part. |
|||
![]() |
|
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 |
|||
![]() |
|
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... ![]() |
|||
![]() |
|
badc0de02 01 Apr 2014, 15:19
edfed,
edfed wrote:
why you not make: Code: include "kernel.asm" BROWSER: include "browser.asm" |
|||
![]() |
|
badc0de02 01 Apr 2014, 16:10
edfed wrote:
why not you use Code: virtual at 0 ;offset ; code ... end virtual |
|||
![]() |
|
badc0de02 01 Apr 2014, 16:18
Quote:
without specific gates our processor will not work. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.