flat assembler
Message board for the users of flat assembler.

Index > Main > flat assembler 1.71.23

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



Joined: 06 Jan 2011
Posts: 359
Location: ukraina
idle
Tomasz Grysztar wrote:
fasm g is not going to be a direct successor to fasm 1

Will it be able to solve what fasm does?
Will it be limited to some architecture/instructions set?
Are you designing an abstraction layer/idea visualizer, fasm as a back-end to convert?
Will it be reusable / mergeable, thus a one will be able use its source-facilities in hiw own project?
Which life shpere is it intended to be?
I wish you good luck in those begininngs, thanx.
Post 27 Oct 2014, 16:28
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
idle wrote:
Will it be able to solve what fasm does?
Will it be limited to some architecture/instructions set?
As I said in that other thread, it will not implement any CPU architecture at all. DB/DW/DD/etc. will be the only instructions that are going to generate any output. One should be able to implement some instruction sets and output formats with macros, and fasm g is aiming to be a replacement for fasm 1 in this niche area, as it should be much better in these (exotic?) applications.

Then fasm 2 could be a future x86-assembler based on fasm g, but I'm not thinking about it right now.

idle wrote:
Will it be reusable / mergeable, thus a one will be able use its source-facilities in hiw own project?
I hope so - on the other hand I have not decided what kind of license I'm going to use. Looking at some of the re-brandings of fasm that already exist I'm having second thoughts about choosing such an open license.

idle wrote:
Which life shpere is it intended to be?
My personal passion above all.
Post 27 Oct 2014, 16:46
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Quote:
it is more like a tiny "probe" sent to investigate new areas

OK. That makes sense.
Quote:
There are also some very subtle differences related to empty values and comma placement

Yes. Thanks. Such subtle things are good to have in mind, when choosing a tool from the existing feature set.

Using the occasion I'd like to ask a question regarding your example from the first post:
Quote:
Code:
x = (x-1)*(x+2)/2-2*(x+1)    

Why is the value of x still zero at the beginning of the second pass? I mean, the initial prediction is "zero, undefined", then it's "zero, defined" at the beginning of the second pass, and only at the beginning of the third pass it's "-3, defined". Why isn't the predicted value -3 already at the second pass?

Btw. you seem to reconcentrate on the high-level stuff, but do you still remember about (or have any plans on improving) more basic issues such as encoding? I mean, for example,
Code:
use64
org 100000000h
lea edx,[0]    

that still doesn't compile (preferably into the eip-relative addressing, which is currently quite inconvenient to do in fasm).

_________________
Faith is a superposition of knowledge and fallacy
Post 27 Oct 2014, 17:11
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
l_inc wrote:
I mean, for example,
Code:
use64
org 100000000h
lea edx,[0]    

that still doesn't compile (preferably into the eip-relative addressing, which is currently quite inconvenient to do in fasm).
This construction is defined to generate RIP-relative encoding, so it is doomed to fail here by specification. Switching to a different mode has to be done manually, like switching to absolute addressing with "lea edx,[dword 0]" or "lea edx,[qword 0]". You are right that EIP-related addressing is currently very inconvenient to use, though. And it perhaps should allow at least [eip-@f] to work here.
Post 27 Oct 2014, 17:47
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Quote:
This construction is defined to generate RIP-relative encoding, so it is doomed to fail here by specification

Well, if we nitpick a bit here, then the manual states, that instruction pointer based addressing is automatically generated, which could refer to ip/eip/rip.

Quote:
It perhaps should allow at least [eip-$] to work here

I think, it does. The above instruction can be compiled with the following code:
Code:
use64
org 100000000h
lea edx,[eip-@F and 0xFFFFFFFF+0]
@@:    

But that's the inconvenience.

Anyway, I think there are other encoding things I find questionable. I remember one about the encoding of positive immediates:
Code:
mov rax,$70000000    

The encoding doesn't seem to be optimal. Does it make sense to put REX here? Moreover it would be functionally equivalent to encode that as
Code:
mov eax,$70000000    

but I'm personally against optimizations that exceed the scope of mnemonic ambiguity.

_________________
Faith is a superposition of knowledge and fallacy
Post 27 Oct 2014, 18:20
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Disregard my last remark about positive immediates. It was one of my old questions, but somehow I didn't realize before that taking away the REX would exactly be covered by my condition of exceeding the scope of mnemonic ambiguity.

However I'm still curious about the justification of an additional pass described in my pre-previous post.

_________________
Faith is a superposition of knowledge and fallacy
Post 27 Oct 2014, 20:57
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
l_inc wrote:
Using the occasion I'd like to ask a question regarding your example from the first post:
Quote:
Code:
x = (x-1)*(x+2)/2-2*(x+1)    

Why is the value of x still zero at the beginning of the second pass? I mean, the initial prediction is "zero, undefined", then it's "zero, defined" at the beginning of the second pass, and only at the beginning of the third pass it's "-3, defined". Why isn't the predicted value -3 already at the second pass?
When an expression contains at least one value that is undefined at the time, the value of whole expression is zeroed (search for [value_undefined] references in exprcalc.inc). If I recall correctly, the initial idea behind it was to prevent large overflows in first passes, but I think it also sometimes helped to reach a little more optimized solution on x86 instructions. But its impact is a minor one, you can experiment yourself by commenting out the piece of code that zeroes the value (it's just before the "expression_value_ok" label).
Post 27 Oct 2014, 22:22
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Quote:
you can experiment yourself by commenting out the piece of code that zeroes the value (it's just before the "expression_value_ok" label)

Well, I still continue to avoid looking into the source code with all those stunning bare numbers Smile, but that did the trick and saved one pass in fact. Your explanation however was perfectly enough to justify the output of my pass-tracing macros. Btw. I think it's also helpful to display the output of the display directive when exceeding the pass limit (the "code cannot be generated" error).

_________________
Faith is a superposition of knowledge and fallacy
Post 27 Oct 2014, 23:02
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
There's a bug in the interpretation of the inequality signs by the new feature:
Code:
macro x args&
{
    common match a:b, args
    \{
        y a
        display 13,10
        b
    \}
}
macro y arg1*, arg2
{
    display arg1,13,10
    match any,arg2 \{ arg2 \}
}
macro nothing {}

x <'Hello',' ','World!'> : nothing    

What is enclosed within the inequality signs is expected to be passed as a single argument to the y-macro (producing the "Hello, World" output). Instead the lower-sign is thrown away and the invocation of the nothing-macro is corrupted.

Besides, I'd also expect the following to compile correctly:
Code:
macro x [args]
{
    common match a:b, args
    \{
        a
        display 13,10
        b
    \}
}
macro y arg1*, arg2*
{
    display arg1,13,10
    arg2
}
macro z arg1*, arg2*
{
    display arg1,13,10
    arg2
}
macro nothing {}

x y '1', <z '2', display 'Hello!'> : nothing    

The expected result is same as when using the new feature instead of the group argument, but fasm's argument validation here is too restrictive. As long as the documentation does not clearly specify this behaviour, much better would be to eliminate all outer matching pairs of the inequality signs (no matter at which place of the corresponding argument and how often these pairs actually appear) and leave the rest as is for the normal case of a single argument processing. For the case of processing in a common block everything should be left as is, which is actually the current behaviour, unless fasm's restrictive validation causes a compilation error.

_________________
Faith is a superposition of knowledge and fallacy
Post 03 Nov 2014, 06:03
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
l_inc wrote:
The expected result is same as when using the new feature instead of the group argument, but fasm's argument validation here is too restrictive. As long as the documentation does not clearly specify this behaviour (...)
It is only allowed to use "<" and ">" characters to enclose an argument in whole. The manual uses the "such argument should be enclosed" phrase, which I thought should be unambiguous enough. The explanation of how "<" and ">" may be nested inside such value is a bit less clear, I may want to polish it up a little. And fasm is not as restrictive there as it could (and perhaps should?) be.

If it was replaced with a mechanism that you propose, "x" macro would get three separate parameters, one being "<z '2'" and the other "display 'Hello!'> : nothing". Removing ":nothing" from the end would be enough to suddenly get two parameters instead of three - and while fasm's syntax is by many already considered quite confusing, I would prefer to not add to the confusion in such a way, hence more restrictions are needed.

As I see it, you created another good example of why "&" feature is better suited for use with "match" and custom syntaxes. Well, it is going to be better suited - when I fix the bug. Thank you for the report!
Post 03 Nov 2014, 09:52
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Quote:
The manual uses the "such argument should be enclosed" phrase, which I thought should be unambiguous enough.

You are right. It is unambiguous with respect to the question: "What to do, if ... ?". But it doesn't answer the question: "What happens, if ... ?" — and hence leaves some free space for possible variations in the details.

Quote:
If it was replaced with a mechanism that you propose, "x" macro would get three separate parameters, one being "<z '2'" and the other "display 'Hello!'> : nothing"

I can't follow the logic. The inequality signs should create a processing context, in which commata are not interpreted as argument separators. This would be pretty much like passing arguments through the (Windows) command line: it's specified everywhere, that you should enclose paths or other arguments with spaces within quotation marks. Like this:
Code:
"C:\Program Files\Internet Explorer\iexplore.exe"    

But in fact you can enclose the spaces only or whatever parts of an argument with the spaces:
Code:
C:\Prog"ram Files\In"ternet" "Explorer\iexplore.exe    

Both would run the Internet Explorer. This kind of processing would not stay in conflict with the current documentation, because it does not specify the behaviour that precisely.
Quote:
Thank you for the report!

Thank you for following and answering the reports.

_________________
Faith is a superposition of knowledge and fallacy
Post 03 Nov 2014, 14:05
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
Tomasz, how about F-Compiler to replace that FASM G? It sounds flat, full, futuristic, classic, low-level and most importantly sounds like a boss that nobody wants to mess up with!! Very Happy
Post 03 Nov 2014, 14:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16890
Location: In your JS exploiting you and your system
revolution
Since we are suggesting alternative names:

fasm-junior:
Code:
C:\Documents and Settings\We are the Borg\Our Documents>fj MyUberProggy.asm
flat assembler junior  version 2.00.00  (1048576 kilobytes memory)
12 passes, 1.5 seconds, 442880 bytes.    
Post 03 Nov 2014, 14:28
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
C'mon revo, we need to get rid of those traditional '...ASM' thingy.

F-compiler sounds like a boss.
fasm-junior sounds like,well,,,, a baby's milk formula.
Post 03 Nov 2014, 14:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16890
Location: In your JS exploiting you and your system
revolution
system error wrote:
C'mon revo, we need to get rid of those traditional '...ASM' thingy.
Why? It's an assembler so it should sound like one.
system error wrote:
F-compiler sounds like a boss.
fasm-junior sounds like,well,,,, a baby's milk formula.
I like milk.
Post 03 Nov 2014, 14:44
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16890
Location: In your JS exploiting you and your system
revolution
system error wrote:
F-compiler sounds like a boss.
Actually it sounds like a compiler for the F language (whatever that is).
Post 03 Nov 2014, 14:46
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
revolution wrote:
system error wrote:
C'mon revo, we need to get rid of those traditional '...ASM' thingy.
Why? It's an assembler so it should sound like one.
system error wrote:
F-compiler sounds like a boss.
fasm-junior sounds like,well,,,, a baby's milk formula.
I like milk.


too many "..asm" out there and it doesn't have to be that way anymore. e,g, A386 or what else I can't remember.

You like milk because you are a SOCCER MOM!! LOL LOL!
Post 03 Nov 2014, 14:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16890
Location: In your JS exploiting you and your system
revolution
system error wrote:
too many "..asm" out there and it doesn't have to be that way anymore. e,g, A386 or what else I can't remember.
At least it is clear what they are. And BTW A386 was an awful assembler with an equally awful author.
system error wrote:
You like milk because you are a SOCCER MOM!! LOL LOL!
I don't get the connection there. I may or may not be a "soccer mom", but how does that relate to liking milk?
Post 03 Nov 2014, 14:54
View user's profile Send private message Visit poster's website Reply with quote
system error



Joined: 01 Sep 2013
Posts: 671
system error
revolution wrote:
system error wrote:
F-compiler sounds like a boss.
Actually it sounds like a compiler for the F language (whatever that is).


I took it that FASM G is a kind of experimental and not quite related to FASM line. I like the idea of having separate line to experiment new things, freeing Tomasz from current architecture limitations, like FASM's own calling convention etc etc ;-p

F-compiler or something similar sounds appropriate.
Post 03 Nov 2014, 14:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16890
Location: In your JS exploiting you and your system
revolution
revolution wrote:
Actually it sounds like a compiler for the F language (whatever that is).
It seems to be a thing:

https://en.wikipedia.org/wiki/F_%28programming_language%29
Post 03 Nov 2014, 15:05
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, 4  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-2019, Tomasz Grysztar.

Powered by rwasa.