flat assembler
Message board for the users of flat assembler.

Index > Main > [fasmg] purpose of restartout ?

Author
Thread Post new topic Reply to topic
fabbel



Joined: 30 Oct 2012
Posts: 84
fabbel 05 Apr 2023, 13:15
Hi

Really can't figure out any use case for restartout instruction..
... might someone pls shed light on this for me ?

.. i mean, i get from the manual :
Quote:

The "restartout" instruction abandons all the output generated up to this point and starts anew with an empty one. An optional argument may specify the base address of newly started output area. When "restartout" has no argument, the current address is preserved by using it as the base for the new area.

The "org", "section" and "restartout" instructions cannot be used inside a "virtual" block, they can only separate areas that go into the output file.


... but fail to see an actual use case for this...
... looks really weird/cryptic to me...


tx
Post 05 Apr 2023, 13:15
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 05 Apr 2023, 13:50
One place where you can find it actually used is in my old assembler emulation project. MASM_COM.ASH contains this part:
Code:
                load COMCONTENT:$%%-100h from :100h
                restartout 100h
                db COMCONTENT    
It is used to reduce the previously generated output, stripping redundant bytes.

Similarly, if you had an existing project that produces some kind of data and you wanted to add additional processing to compress the generated file and only keep the shrunk version, this command would help to do it easily, while allowing the base project to still use facilities like ORG or $%.

It is also worth noting that even though previous output areas are discarded from the list of data blocks to write into the final file, their contents can still be accessed with LOAD commands, but only through an area label (defined with "::").
Post 05 Apr 2023, 13:50
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 © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.