flat assembler
Message board for the users of flat assembler.

Index > Programming Language Design > On my new assembler

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 18 Sep 2017, 19:56
The auxiliary file creation is available now. All you need to is add AS 'EXT' phrase in the declaration of VIRTUAL block:
Code:
virtual at 0 as 'log'
    db 'some auxiliary information'
end virtual    
This can be useful to generate an external debug information, for example.
Post 18 Sep 2017, 19:56
View user's profile Send private message Visit poster's website Reply with quote
VEG



Joined: 06 Feb 2013
Posts: 80
VEG 19 Sep 2017, 04:41
Tomasz Grysztar wrote:
These additions open up a way for the option of generating multiple files from one source, which I've been planning for years. It would be limited to declaring the extensions of the produced files, analogously to the main file.
Nice thing, thanks. I even already have an idea of a project where it is a necessity =)
Post 19 Sep 2017, 04:41
View user's profile Send private message Visit poster's website Reply with quote
jacobly



Joined: 04 Feb 2016
Posts: 44
jacobly 02 Oct 2017, 07:15
The addition of format affected the forward referenceability of a format macro I wrote, and while trying to fix it, I realized that a nice solution would be to redirect format? type args& to format?.type args. It seems like this would be a useful feature to have in fasmg natively, similar to how the end directive is implemented, which would make defining custom formats easier.
Post 02 Oct 2017, 07:15
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 02 Oct 2017, 08:15
jacobly wrote:
The addition of format affected the forward referenceability of a format macro I wrote, and while trying to fix it, I realized that a nice solution would be to redirect format? type args& to format?.type args. It seems like this would be a useful feature to have in fasmg natively, similar to how the end directive is implemented, which would make defining custom formats easier.
This is exactly how it works internally, even if I did not document it.

PS. I have update the Windows headers package to use this variant, forward-referenced FORMAT does work correctly there. I guess I need to make this a documented feature then.
Post 02 Oct 2017, 08:15
View user's profile Send private message Visit poster's website Reply with quote
jacobly



Joined: 04 Feb 2016
Posts: 44
jacobly 02 Oct 2017, 18:33
Indeed it does work correctly, I just forgot to search for the next occurence of format in tables.inc...
Post 02 Oct 2017, 18:33
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 11 Oct 2017, 17:07
I have made another tiny addition to the language, which addresses two separate but similar problems.

First is the problem with defining a variable named like one of the instructions. The trick with a trailing dot often works, but the explanation of why it helps is quite complex, and this does not reliably work in all cases - for example trying to define case-insensitive "irp" as a variable with "irp?." identifier would still fail.

Second, much less important problem is related to the recent addition of a support for numeric names inside identifiers. While this allowed to define such named symbols inside explicitly specified namespaces, there is no way to directly define or access such symbol from inside such namespace unless the parent symbol of the namespace is known.

I have introduced a new syntax variant - with added "?" character right at the start of an identifier - that helps to define symbols with problematic names as mentioned above:
Code:
?IRP equ 0007h  ; defines case-sensitive symbol IRP

namespace IRP
        ?1 = 'test'
end namespace

display IRP.1    
Post 11 Oct 2017, 17:07
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 15 Oct 2017, 09:32
The addition of VIRTUAL AS has also pushed me to enable a feature that was long lurking from under the surface of fasmg engine, but I was postponing its inclusion because I was not sure what syntax should it use.

That feature is the ability to "continue" previously closed VIRTUAL block, allowing to append new data definitions at the end of such block.

I decided to use the simplest possible syntax for it, just VIRTUAL followed by the area label that needs to refer to a previously defined VIRTUAL block:
Code:
        virtual at 0 as 'log'
                Log::
        end virtual

        virtual Log
                db 'Hello!',13,10
        end virtual    
(this is an example from the updated manual).

Not only does it allow to easily build auxiliary files piece after piece, this feature also makes it much easier to implement things like switching back and forth between definitions for code segment and data segment, etc. Multiple program segments can be assembled in parallel in virtual blocks, and only when they are finished they may be copied into an actual output. This is something that was very hard to do in the fasm 1 architecture, but is really easy within the design of fasmg.
Post 15 Oct 2017, 09:32
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.