flat assembler
Message board for the users of flat assembler.

flat assembler > Main > Byte counter

Author
Thread Post new topic Reply to topic
Jin X



Joined: 06 Mar 2004
Posts: 40
$ is current address counter
But there's no current byte counter Smile
To write something like:
Code:
rb 510-$$$ dw 0xAA55

without reference to address changing... Smile

Maybe it's a good idea to add this feature? Smile
Post 09 Jul 2018, 16:40
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6873
Location: Kraków, Poland
This feature is present in fasmg with $% symbol. In fasm 1 there is not way to reliably provide such value because of how the formatter works.

It might, however, be possible to back-port $% into fasm 1 restricted only to "format binary" output. I may consider it.
Post 09 Jul 2018, 17:01
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 257
Location: Belarus
Wouldn’t it break the feature that allows saving generated data into multiple files? I mean, should we count all the bytes or bytes of a specific addressing space?

The original problem is nearly always solved by replacing the said $$$ with ($ – $$) since it’s pretty difficult to put code running from another memory location to the boot sector if you play fairly and read FAT12 without implying the secondary bootloader is the first file written to disk and stuff like that.
Post 09 Jul 2018, 20:40
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6873
Location: Kraków, Poland
DimonSoft wrote:
Wouldn’t it break the feature that allows saving generated data into multiple files? I mean, should we count all the bytes or bytes of a specific addressing space?
As it is defined and implemented in fasmg, it traces the current length of the main output, any auxiliary outputs do not count.
Post 09 Jul 2018, 21:13
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 257
Location: Belarus
I would think about all the possible variations at once since it won’t take long for people to ask more and further (consistent from language point of view) improvements might become more difficult by that time. A language constantly extended with features that are just easy to implement approaches C++ as the number of such features approaches infinity.
Post 09 Jul 2018, 22:35
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6873
Location: Kraków, Poland
DimonSoft wrote:
I would think about all the possible variations at once since it won’t take long for people to ask more and further (consistent from language point of view) improvements might become more difficult by that time. A language constantly extended with features that are just easy to implement approaches C++ as the number of such features approaches infinity.

fasmg was designed mostly to be a sum of all the things requested for fasm 1 over the years that were not always possible within the old framework. How it ended up? Actually, for several years I believed this design was impossible, since many of the goals were conflicting. I finally started working on it in 2014 when I found a way to put all these things together in a way that did not make them fall apart immediately. And it seems to work, at least I'm happy with how it works. But because it was so hard to find not a self-contradicting solution in the first place, it is also not so trivial to extend it further. Features that may look simple and consistent with the rest of language at first look, may show multiple problems upon closer inspection. This is also a reason why I prefer to have things implemented through macros and simpler features whenever possible. When something is "just a macro", it is easier to forgive some of the rough edges it might have. But when something has to be a part of underlying language, it should work well with the rest of it, and in case of design like fasmg this is not an easy task.
Post 09 Jul 2018, 22:54
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:  


< 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 © 2004-2018, Tomasz Grysztar.

Powered by rwasa.