flat assembler
Message board for the users of flat assembler.

Index > Main > Understanding fasm (draft)

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
The exact algorithms used to make predictions are the inner secrets of fasm Wink It may find the solution, or fail, but what you can always be sure is that when it make you an output, it is always the correct one.
As for revealing what exactly the prediction mechanism are, I'm not doing it just because they still may change when something better is invented. I even rewrote the section 2.2.6 of manual to not define too much about behaviour of prediction algorithms, to prevent programmers from relying on them.
To one thing you should always assume: you cannot know what values the labels have during the intermediate passes.


Last edited by Tomasz Grysztar on 29 Jan 2006, 14:04; edited 1 time in total
Post 29 Jan 2006, 14:02
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
I'm sorry, there was an error in my calculations - I edited, but you were quicker Smile

EDIT: Removed everything my logic didn't calculate Razz


Last edited by Madis731 on 29 Jan 2006, 14:35; edited 2 times in total
Post 29 Jan 2006, 14:04
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
And there is one more thing: y is calculated after the x, and here the interpreted layer comes in - y uses just the value of x already calculated in the current pass. That gives me a hint to write something about it in the article.
Post 29 Jan 2006, 14:10
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Nice - can't wait to read another section Very Happy

btw, an easy code to make the assembler suffer:
Code:
dd x,y
;7 passes
x= 14+y
y= 120/x
    

Code:
dd x,y
64 passes
x=y+y
y=x-2
    

I'm doing Neural Networks right now so I'm really interested in "learning" like this Wink
Post 29 Jan 2006, 14:19
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
Well, this 64-passes one is really interesting. Sometimes fasm suprises even me. Wink
(Don't get me wrong - I understand what happens here, I just didn't realize earlier that this may actually happen and that fasm is able to solve this one)
Post 29 Jan 2006, 18:44
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
r22 wrote:
Another thread tangent.

http://developer.amd.com/devtools.aspx
At the bottom of this page it lists NASM and YASM as suggested free assemblers to use.

If you feel as I do, that FASM should be on that list, then make sure to click on the "Contact Us" link at the bottom of the page and voice your opinion to AMD.

They say NASM has an AMD64 support? Moreover, the link they provide doesn't work.

I already once tried contacting them about linking to fasm, but hadn't got any response and I gave up.
Post 30 Jan 2006, 09:02
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
http://sourceforge.net/projects/nasm/ is the only working URL for NASM right now (and has been like that for a few weeks, dunno why). Mach-O output support seems to be the only recent major feature update.
Post 30 Jan 2006, 19:49
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
Slowly getting more close to the "meat". After I finish explaining some important fact about macroinstructions there will come section summarizing the analogous features of different layers (like difference between REPEAT and REPT), and then some "lessons" about how to make the layers cooperate and utilize them to the extremes - I plan a step-by-step explanation of the complex macros like "struct" or "proc" as a base examples for those "lessons".
Post 11 Mar 2006, 21:39
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Good progress, but seems like you were a little in a hurry in the end, in the last section, just a few type'os:

1) '...fed into the assembled' <= shouldn't it be 'assembler' or 'assembled <something>'?
and a few lines later:
2)"This example show how" <= should be 'shows'

Otherwise, fun to read again Wink
Post 11 Mar 2006, 23:43
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
After I started the section about macros I decided to move it to the documentation section, since the text became too large to maintain it here. It doesn't really mean it's close to be finished, though - there are so many things I'd like to write about, however I have to keep the track of what should be explained in what order to make it as clear as possible.

BTW, I also updated the manual there to the most up-to-date one for fasm 1.65, and called the 1.64 the "last milestone" release instead of the "last stable" - to avoid preventing people from getting the latest fixes and features just because of considering the development releases "unstable" (though some of them sometimes are Wink).
Post 18 Mar 2006, 10:49
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
In the macros section under the child macro there is:
"And the manual explain" in the end of a fourth line, should be "And the manual explains"

six lines down:
"and thus they only way to close", should be "and thus the only way to close"

Good examples at the end of the article Smile
Post 20 Mar 2006, 09:51
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
Thanks for your constant feedback! Wink
Post 21 Mar 2006, 08:34
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
Madis731 wrote:
Nice - can't wait to read another section Very Happy

btw, an easy code to make the assembler suffer:
Code:
dd x,y
;7 passes
x= 14+y
y= 120/x
    

Code:
dd x,y
64 passes
x=y+y
y=x-2
    

I'm doing Neural Networks right now so I'm really interested in "learning" like this Wink

wow Wink
fasm can solve linear equations?
next thing whould be to add support for matrices, solve with cramer's law let's say.

hehe better code to make a parser suffer is:
Code:
dd x,y,z
x=2*y+1
y=z-2*x
z=x+2*y

;2*y+1=x
;z-2*x=y
;x+2*y=z
;
;2*y+1=x
;(x+2*y)-2*x=y
;
;(2*y+1+2*y)-2*(2*y+1)=y
;
;4y+1-4y-2=y
;
;-1=y
;-1=x
;-3=z
    

we could give an assembler the 4x3 matrix with variables Wink
could do your homework too by writing the steps ...
Post 08 Apr 2006, 08:49
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Matrix: this is just side effect of fasm's multi-pass system. It's way it solves such things is not very mathematical and not very good, and often it doesn't lead to result. It's main feature is that: if it produces some result, you can be sure it is good. There's reason need to add such things, that would be counterproductive.
Post 08 Apr 2006, 09:07
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
the problem is mainly that division is integer-only, so any problems involving division will have reduced accuracy
Post 09 Apr 2006, 18:01
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
I'm back and just wrote another section - explaining the tokenization in order to prepare ground for detailed explanations on IRPS and MATCH.
But at the same time I had a good opportunity to describe the things about "source reader" in details (and, in particular, explain the current place of the FIX directive in the overall image).

Perhaps this whole article is still too much a compact form in some places, but there are so many important things I want to write about there, that I'm not able to dwell too long about some single details. Wink I just hope this can be enough to understand how all those things work by some people that may then write their own, easier, tutorials etc.
Post 15 Jun 2006, 12:21
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
r22 wrote:
Another thread tangent.

http://developer.amd.com/devtools.aspx
At the bottom of this page it lists NASM and YASM as suggested free assemblers to use.

If you feel as I do, that FASM should be on that list, then make sure to click on the "Contact Us" link at the bottom of the page and voice your opinion to AMD.

They don't seem to be interested in revalidating/updating that page, do they?
Post 04 Aug 2006, 17:01
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

< 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.

Powered by rwasa.