flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > [fasmg] New method of preprocessing included file |
Author |
|
Tomasz Grysztar 22 Apr 2021, 17:17
I've found a very simple implementation of a small feature that allows to enable a preprocessor for an included file without the usual trickery.
Based on version j6ia, the patch looks like this: Code: ================================================================== --- source/directives.inc +++ source/directives.inc @@ -1282,11 +1282,17 @@ mov [edx+SymbolTree_Root.chain],eax new_parameter_namespace_ok: and [eax+SymbolTree_Root.parameters],0 mov [ebx+SourceEntry.local_namespace],eax pop esi - jmp instruction_assembled + call get_constituent_value + jc instruction_assembled + cmp al,',' + jne instruction_assembled + cmp [number_of_line_embeddings],0 + jne invalid_argument + jmp assemble_after_label include_stack_limit_exceeded: pop esi mov edx,_stack_limit_exceeded call register_error jmp instruction_assembled Code: include 'hello.asm', display 'The file has been read, time to process it...' Code: macro preprocess! line& display `line,10 end macro include 'hello.asm', mvmacro ?,preprocess If you find it useful, please let me know. The implementation is so cheap, that I may consider adding it as an official feature, although it's one that may look a bit confusing unless you understand the specific problem that it solves. |
|||
22 Apr 2021, 17:17 |
|
bitRAKE 26 Apr 2021, 22:55
This also allow a much cleaner solution to my file name trick to self-include a file in a different state. Probably eliminates half my passing code on the command-line, too.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
26 Apr 2021, 22:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.