flat assembler
Message board for the users of flat assembler.

 Index > Main > fasm&fasmg
Author
l4m2

Joined: 15 Jan 2015
Posts: 661
l4m2
In fasm there are three kinds of IF X=0:
Code:
match =0, x {
...
}
Code:
if x = 0
...
end if
Code:
cmp x, 0
jnz lab
...
lab:

In fasmg only two?
Code:
if x = 0
...
end if
Code:
jnz lab, x
...
lab:

How does fasm&fasmg know x is linear function of a, b, c?(a, a+b, a+b+1 are, but a*a, a+d aren't)
14 Aug 2016, 16:08
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
revolution
You are mixing all the stages of the process together and confusing yourself. fasm has preprocessor and assembler stages, whereas fasmg has combined those into the same stage. The generated code is executed at runtime.

To answer your second question: fasm doesn't know if anything is a linear function of anything else. It just tries to find values that produce a valid solution. There may be other solutions that are also valid and fasm can completely miss them.
14 Aug 2016, 19:32
l4m2

Joined: 15 Jan 2015
Posts: 661
l4m2
revolution wrote:

You are mixing all the stages of the process together and confusing yourself. fasm has preprocessor and assembler stages, whereas fasmg has combined those into the same stage. The generated code is executed at runtime.

When I see a topic, usually I can't know whether it's a processing code or an executing code, thus mixing them is acceptable.
revolution wrote:

fasm doesn't know if anything is a linear function of anything else.

I tried these cases:
Code:
lea eax, [3*ecx-2*ecx]      ;OK
lea eax, [ecx*ecx-ecx*ecx]  ;Error

which means that fasm requires all the summed elements to be linear
15 Aug 2016, 01:28
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
revolution
l4m2 wrote:
I tried these cases:
Code:
lea eax, [3*ecx-2*ecx]      ;OK
lea eax, [ecx*ecx-ecx*ecx]  ;Error

which means that fasm requires all the summed elements to be linear

BTW: Did you try [ecx*(ecx-ecx)*ecx]?
15 Aug 2016, 01:51
l4m2

Joined: 15 Jan 2015
Posts: 661
l4m2
revolution wrote:
Did you try [ecx*(ecx-ecx)*ecx]?
No. But maybe my "element" should be "monomial"
15 Aug 2016, 02:06
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
revolution
l4m2 wrote:
When I see a topic, usually I can't know whether it's a processing code or an executing code, thus mixing them is acceptable.
Only if you find it acceptable to confuse yourself.

But seriously, if you don't understand at least the preprocessor vs assembler difference then you will have a hard time understanding complex macros.
15 Aug 2016, 02:27
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum