flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
fabbel 06 Oct 2025, 12:18
.. another was to put it: **any** code that is 'installed' after pospone directive will get executed at end of script, be it regular fasmg (macro) code / directives, or even alm code (even if part of enclosing calm inx)
|
|||
![]() |
|
Tomasz Grysztar 06 Oct 2025, 14:28
fabbel wrote: 1/ flat assembler manual wrote: The file is first searched for in the directory containing file which included it and when it is not found there, the search is continued in the directories specified in the environment variable called INCLUDE (the multiple paths separated with semicolons can be defined there, they will be searched in the same order as specified). If file was not found in any of these places, preprocessor looks for it in the directory containing the main source file (the one specified in command line). fabbel wrote: while playing with postpone for inspiration / see how to collaborate with it, I came to experience behavior of postpone that I was not expecting (but came to like / cope with) : I recall I briefly experimented with POSTPONE being a single-use macro (similarly to how it was implemented in the preprocessor of fasm 1), but implementing it as a control directive felt simpler and more elegant. |
|||
![]() |
|
fabbel 06 Oct 2025, 15:29
thx for feedback !
Regarding postpone, indeed, it is defined as a control directive in the manual... it is just that I initially didn't anticipate this kind of effect (even if now appreciate like it is ) ... just wanted to share experience really ... i mean control directives are - for me - associated with "regular code" (as opposed to alm code, mean typ. directive like 'repeat/end repeat', 'if/end if', ... cannot normally show up inside calm inx impl., while, conversly, alm can only appear between calminstruction... end calminstruction) ... so it just confused my understanding as I initially just didn't not expect postponed execution - even if directive - to be able to call/jump directly inside alm code w/o explicit switch to alm ... at some point while experimenting, I even thought that at end of script, postpone was starting again from initial postpone statement, thus re-executing the whole postpone override code again ... before I realized it is really the "intrinsic" postpone directive itself that is setting the point of exec at end of script - no matter what/where that is.... |
|||
![]() |
|
Tomasz Grysztar 06 Oct 2025, 18:11
The state of fasmg's control flow can be stored and resumed at any point. This is essential for things like CALM code calling a macro, which in turn may call another CALM instruction and so on. A simple example with REPEAT (another control directive) demonstrates that everything can be rewound:
Code: calminstruction demo asm repeat 3 display '!' end calminstruction demo end repeat What makes it especially tricky is the fact that CALM commands like DISPLAY do not obey the assembly state which for normal (textual) instructions determines whether to execute only the unconditional ones (like when REPEAT has 0 count, or IF has a false condition, or POSTPONE is executed during the normal assembly pass, which also puts it into this "skip block" mode). It makes these command essentially like unconditional instructions and this is what caused the message to show up twice in your example. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.