flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [fasm1 forever] Multisections .code .data .stream

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
No matter what I do the streams can be declared no more than 3 times. Otherwice it going out of memory Sad
Even of that it takes extra time to compile. I understand why. 'includes' unroll itself in loop even where out of condition.

Code:
        macro .stream arg
        \{      
                end if
                if cuRRent=lastcuRRent
                        streamcuRRent=\`arg
                        savedcuRRent=cuRRent
                        cuRRent='stream'
                if savedcuRRent=lastcuRRent
                        include entry_file
                end if
                        cuRRent=savedcuRRent
                        streamcuRRent='none'
                        savedcuRRent='none'
        \}
        macro .frame param
        \{
                end if
                if cuRRent='stream' &savedcuRRent=lastcuRRent &streamcuRRent=\`param
        \}
        streamcuRRent='none'    


Description:
Filesize: 114.04 KB
Viewed: 1339 Time(s)

Capture.JPG


Post 23 Apr 2022, 22:09
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
1) Would you like to add RIP, RFL and at least 64 bytes from [RSP] to your complete error information?
2) Are you trying to make the code as unreadable as possible? Mixing code with data already makes it difficult to read. You've already placed a lot more here.
Post 23 Apr 2022, 22:28
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
macomics wrote:
1) Would you like to add RIP, RFL and at least 64 bytes from [RSP] to your complete error information?
2) Are you trying to make the code as unreadable as possible? Mixing code with data already makes it difficult to read. You've already placed a lot more here.

1) I want to add a lot of info, even memory mapping, some day. It is not important at the moment.
2) It is just example. My code is more than readable as it have all data close to it, if needed. Don't you say C#/+ unreadable where data defined exactly before functions, as usual?
Current stream directives needed for macros only, to make one macro for a lot of different things: complete different structures and past some code at same time, for example.
Post 23 Apr 2022, 22:52
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Overclick wrote:
Don't you say C#/+ unreadable where data defined exactly before functions, as usual?
I read your source code from the screenshot. It is no longer readable.

In code that actively uses global variables after some development time, it can be difficult to find a place to declare such a variable.
After a couple of months, you will simply forget that the global variable was declared in a particular text and you will have to read it for a one.

In MASM or TASM you had to declare external to define the names used. Names are declared within a single binary block .obj. For fasm, you will have to actively compose long comments or you will constantly come up with new names because there are already such.

I don't care about .code and .data, but it seems to me that you are already too absorbed. Leave the lite version with a minimal set of "directives".
Post 23 Apr 2022, 23:34
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

I read your source code from the screenshot.

It is not source at all.It's testing. Ofcource I don't write like that.

Quote:

In code that actively uses global variables after some development time, it can be difficult to find a place to declare such a variable.

Actually IDE shows me position of any "forgoten" data if its name mixed up or needed to be find. The "problem" is for FASM users only, don't you think? We don't need it if we don't have it?

Quote:

In MASM or TASM you had to declare external to define the names used

Not sure for that, but any way who care?

Quote:

I don't care about .code and .data

So what do you doing here? Do you have any example of perfect coding of huge projects by simple past subprograms by only single macros? I have such, and my .namespace is different from fasmg but lets me to past it without any worry of name mixing. Even that ShowERROR macro writen by one macro only and can be used multiple times in different parts of code. Ofcourse it can be updated to full windowed applicaton later to help me debug my projects. And even of that I will have no problem of mixing of anything as I've done my Multisections additional directives.


Description:
Filesize: 90.94 KB
Viewed: 1322 Time(s)

Capture.JPG


Post 24 Apr 2022, 00:20
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Overclick wrote:
The "problem" is for FASM users only, don't you think? We don't need it if we don't have it?
Then why are you posting it?
Overclick wrote:
I have such, and my .namespace is different from fasmg but lets me to past it without any worry of name mixing.
Judging by the approach used - no. With .multisection only the length of the text increases by 4 times.
Post 24 Apr 2022, 01:00
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

Then why are you posting it?

For those who need it.
Quote:

With .multisection only the length of the text increases by 4 times

LOLWHAT? Just tested, all output exactly the same. Or what kind of text do you mean?
Post 24 Apr 2022, 01:42
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
x1
code wrote:
Code:
    forward
        if cuRRent='idata'
                include entry_file
        end if    
x2
code wrote:
Code:
forward
        if cuRRent='data'
                .endnamespace
                include entry_file
        end if    
x3
code wrote:
Code:
forward
        if cuRRent='code'
                .endnamespace
                include entry_file
        end if    
Okay, not x4, but x3. All the same, this is a multiple increase in the text for the sake of the doubtful comfort of writing a program. For a large project, it's like death.

However, you did not hear me again. If you want to add something, just add it. But leave the lite version in its current form.
Post 24 Apr 2022, 02:31
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

Okay, not x4, but x3. All the same, this is a multiple increase in the text for the sake of the doubtful comfort of writing a program. For a large project, it's like death.

Oh, my mistake, I thought you were more qualified. It's not x3 or something, believe me.
Post 24 Apr 2022, 08:52
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
That is example for .stream .frame directives
Single macro prepares strings for two different structures and do some code in place where declared.
Code:
.data
        struc           MYD2D1LAYERS
        {       .GuiGeneral             MYLAYERSPROPS 1,1,1,1,\
                                                                100,100,150,150
        }       

        pGuiLayer               MYD2D1LAYERS
                .stream forLayer
        pGuiLayerEndStruct = $
...
.code
...
Render:
   rend textureone,0,0,50,50
   rend texturetwo,50,50,100,100
   rend...
   ...
    


Description:
Filesize: 46.85 KB
Viewed: 1290 Time(s)

Capture.JPG




Last edited by Overclick on 24 Apr 2022, 11:27; edited 1 time in total
Post 24 Apr 2022, 11:23
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Overclick wrote:
It's not x3 or something, believe me.
So you don't even know what fasm does with its sources.
Post 24 Apr 2022, 11:23
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

So you don't even know what fasm does with its sources.

Yes, I'm stupid, I don't understand how conditional operators works [facepalm].
As I said all tested, output exactly the same, but you still arguing with me.
Post 24 Apr 2022, 11:33
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Before it comes to conditional statements, the sources must be loaded. The preprocessor does not process conditional statements. Thus, the text is processed in full after the preprocessor without exclusions.
Post 24 Apr 2022, 11:39
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

Before it comes to conditional statements, the sources must be loaded. The preprocessor does not process conditional statements. Thus, the text is processed in full after the preprocessor without exclusions.

That loads compilation only, who cares?


Description:
Filesize: 33.66 KB
Viewed: 1277 Time(s)

Capture.JPG


Description:
Filesize: 30.77 KB
Viewed: 1277 Time(s)

Capture.JPG


Description:
Filesize: 33.34 KB
Viewed: 1277 Time(s)

Capture.JPG


Post 24 Apr 2022, 11:53
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
macomics wrote:
Overclick wrote:
Do you have any example of perfect coding of huge projects by simple past subprograms by only single macros? I have such, and my .namespace is different from fasmg but lets me to past it without any worry of name mixing.
Judging by the approach used - no.
Anyone who has worked with a huge project should also take care of this. Increasing the source text by 3 times at least reduces your huge project to an average level.

You were caught by the tongue. Don't try to get out of it.
Post 24 Apr 2022, 12:13
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

You were caught by the tongue. Don't try to get out of it.

Are you drunk? Did you see my screenshots? Пасху гуляешь?
Post 24 Apr 2022, 12:47
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Overclick wrote:
Quote:

You were caught by the tongue. Don't try to get out of it.

Are you drunk? Did you see my screenshots? Пасху гуляешь?
So I say that you were caught by the tongue. This is the number of bytes in the output file. And you fill the buffer allocated above (1048576 kilobytes). Only and this is also only the length of the buffer, but not the number of bytes used in it.
Post 24 Apr 2022, 12:54
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

So I say that you were caught by the tongue. This is the number of bytes in the output file. And you fill the buffer allocated above (1048576 kilobytes). Only and this is also only the length of the buffer, but not the number of bytes used in it.

Isn't it enough for single file output? Extend limits then.


Description:
Filesize: 39.88 KB
Viewed: 1251 Time(s)

Capture.JPG


Post 24 Apr 2022, 13:05
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 593
Location: Russia
macomics
Good luck. fasm1 is a 32-bit application on its own. How much more can you add? 2097152?

ADD: Judging by what you gave out. The total length of the source text you have is about 10 kb. It doesn't look like a big project.
Post 24 Apr 2022, 13:21
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 512
Location: Ukraine
Overclick
Quote:

ADD: Judging by what you gave out. The total length of the source text you have is about 10 kb. It doesn't look like a big project.

It is not. It's just a testing area, multiplied 100000 times to show your mistake but still small for SINGLE FILE. Ok
Post 24 Apr 2022, 13:47
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  Next

< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.