flat assembler
Message board for the users of flat assembler.
Index
> Main > [fasmg] Parametrized assembly |
Author |
|
Tomasz Grysztar 15 Apr 2017, 09:02
There is no such option at the moment.
|
|||
15 Apr 2017, 09:02 |
|
Tomasz Grysztar 15 Apr 2017, 10:23
The option I had in mind for fasmg would allow to prefix source with any line of text specified in command line. This way it would be possible not only to define symbols from command line, but for example include an additional file, like an instruction set:
Code: fasmg -i DEBUG=1 source.asm output.bin fasmg -i INCLUDE('x64.inc') test.asm test.bin |
|||
15 Apr 2017, 10:23 |
|
Tomasz Grysztar 15 Apr 2017, 17:19
You gave me an impulse to finally implement it, I had it mostly figured out anyway. The syntax is exactly as I proposed above, and these samples should work correctly.
Since -I allows to execute any command or even a sequence of commands, it allows to do some interesting tricks. It is now possible to generate an output without any source file: Code: ; in Windows: fasmg nul -i "db 256 dup $" ascii.bin ; in Linux: fasmg /dev/null -i "db 256 dup $" ascii.bin Code: ; in Windows: fasmg nul nul -i "display 74" ; in Linux: fasmg /dev/null /dev/null -i "display 74" Code: ; in Windows: fasmg nul nul -i "x = 1 shl 500" -i "repeat 1, v:x" -i "display `v" -i "end repeat" ; in Linux: fasmg /dev/null /dev/null -i "x = 1 shl 500" -i "repeat 1, v:x" -i "display `v" -i "end repeat" |
|||
15 Apr 2017, 17:19 |
|
marste 15 Apr 2017, 17:38
Great Tomas!!! Above any excpectations!!!
After your first reply I implemented the renaming file trick, but I'm happy to undo everything and start using this fantastic possibility!!! I think it will be useful for a lot of people and situations... Thank you!!! |
|||
15 Apr 2017, 17:38 |
|
zhak 15 Apr 2017, 20:13
this is indeed a very cool option
|
|||
15 Apr 2017, 20:13 |
|
jmg 17 Apr 2017, 06:02
marste wrote: ... I've usually done simply that, but this new feature allows both methods, and can be easier to maintain. Looks nice. |
|||
17 Apr 2017, 06:02 |
|
mrvl 23 Apr 2017, 09:07
Thank you so much for your work, Tomasz!
I have a small problem with this code: Code: fasmg nul test.bin -i "dd %t" fasmg says: Quote: eval [1]: Is the introduction of support expected for %t? |
|||
23 Apr 2017, 09:07 |
|
Tomasz Grysztar 23 Apr 2017, 10:27
mrvl wrote: I have a small problem with this code: Code: fasmg nul test.bin -i "dd %%t" |
|||
23 Apr 2017, 10:27 |
|
marste 07 Sep 2017, 23:28
I've got a segmentation fault seems after using 16 times the "-i" options (in one single compile): there is such a limit?
|
|||
07 Sep 2017, 23:28 |
|
Tomasz Grysztar 08 Sep 2017, 07:22
There are no limits, you must have found a bug. What is the command line that causes it? Does it happen consistently? Does it depend only on the command line and not source text?
|
|||
08 Sep 2017, 07:22 |
|
marste 11 Sep 2017, 18:36
Following one example of this:
Code: nome="1kRealChess81-F23-DEBUG" ../fasmg \ -i 'ROMPLATFORM equ "ZX81"' \ -i 'FLICKERFREE=0' \ -i 'ALFABETA=1' \ -i 'BEAUTY=1' \ -i 'PLAYING equ "FLEXIBLE"' \ -i 'FLEXIBLEMOVEBOOK=0' \ -i 'MAXPLY=3' \ -i 'QUIESCENCESEARCH=1' \ -i 'MAXPLY_QUIESCENCESEARCH=4' \ -i 'MOVESELECT equ "FIRST"' \ -i 'INCREASINGPLY=0' \ -i 'MOVEORDERING=1' \ -i 'DEBUG=1' \ -i 'DEBUGBLACKSTART=1' \ -i 'MAXPLY_QUIESCENCESEARCH=0' \ -i 'HUMANCOLOR=0' \ -i 'ZX81COLOR=8' \ sm1kzx8x.asm $nome.p > $nome.lst And this is the result: Code: ./build.sh: line 84: 13227 Segmentation fault (core dumped) ../fasmg -i 'ROMPLATFORM equ "ZX81"' -i 'FLICKERFREE=0' -i 'ALFABETA=1' -i 'BEAUTY=1' -i 'PLAYING equ "FLEXIBLE"' -i 'FLEXIBLEMOVEBOOK=0' -i 'MAXPLY=3' -i 'QUIESCENCESEARCH=1' -i 'MAXPLY_QUIESCENCESEARCH=4' -i 'MOVESELECT equ "FIRST"' -i 'INCREASINGPLY=0' -i 'MOVEORDERING=1' -i 'DEBUG=1' -i 'DEBUGBLACKSTART=1' -i 'MAXPLY_QUIESCENCESEARCH=0' -i 'HUMANCOLOR=0' -i 'ZX81COLOR=8' sm1kzx8x.asm $nome.p > $nome.lst If I remove the last three -i it works! PS: flat assembler version g.hwx32 PS2: Ubuntu 16.04 (64 bit) |
|||
11 Sep 2017, 18:36 |
|
Tomasz Grysztar 11 Sep 2017, 20:51
There was a bug in the string storage, only uncovered when the total length of text generated by -I parameters was more than 256.
Please try the "hx7tl" version. |
|||
11 Sep 2017, 20:51 |
|
marste 12 Sep 2017, 21:44
Tomasz Grysztar wrote: There was a bug in the string storage, only uncovered when the total length of text generated by -I parameters was more than 256. It works now! |
|||
12 Sep 2017, 21:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.