flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > A move for ASM standardization

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 23 Oct 2008, 18:14
Hi Tomasz,

Agner asked for a place to discuss future syntax of ASM compilers and a prossible effort to standardize the syntax and i have created such a forum here: http://www.oby.ro/forum/viewforum.php?f=24

If you and other compiler creators (Octavio, Betov, etc) or people with high interests in ASM want to participate then you are kindly invited.

The discussions are slightly MASM oriented but we do not exclude other assemblers syntax since I am "guilty" of having my own point of view and I think you and FASM have a lot to say into this talks.

Anyway an effort for standardization of ASM or at least some syntax guide or recommendations are useful IMHO.

_________________
"Any intelligent fool can make things bigger,
more complex, and more violent.
It takes a touch of genius -- and a lot of courage --
to move in the opposite direction."
Post 23 Oct 2008, 18:14
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 25 Oct 2008, 00:54
> Anyway an effort for standardization of ASM

http://www.masm32.com/board/index.php?topic=10165.0

Quote:

MASM syntax is the closest we get to a de facto standard

Quote:

If I had not already started using Masm, I would consider it.

Quote:

However Thomas (creator of FASM) or Octavio (creator of Octasm) or Betov (creator of RosASM) are not here.

fixed (see post below):
Quote:

However Tomasz (creator of FASM) or Octavio (creator of Octasm) or Betov (creator of RosASM) are not here.


Laughing

Quote:
Gas supports Intel syntax because everybody hates the AT&T syntax.


Not true (but at least I do ...).


Last edited by DOS386 on 25 Oct 2008, 11:30; edited 1 time in total
Post 25 Oct 2008, 00:54
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 25 Oct 2008, 01:01
i want to just have to set an optional command to the compiler to compile it as a PIC or ARM or 68k or 68HC or x86 or TMS320 or etc etc code using always my dear fasm x86 syntax and mnemonics, macro converting it in optimised machine code.

THAT's ALL FOLKSSsss!!!!!
Post 25 Oct 2008, 01:01
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 25 Oct 2008, 01:27
Sorry for the typo I made with Tomasz's name.
Post 25 Oct 2008, 01:27
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 25 Oct 2008, 02:03
FASM syntax is the best, all others should adopt FASM syntax
Post 25 Oct 2008, 02:03
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 25 Oct 2008, 05:42
bogdanontanu, you mean a bunch of old men are getting together to talk about what syntax they are comfortable with. We should all thank you for corralling them. With as frequent as the instruction set changes standard hardly has a meaning. It would be more fruitful to discuss how to expand assembly language to make the syntax more extensible, and dragging a ton of legacy crap into the mix taints the brew from the start. If nothing beyond standardization is being offered then why should anyone adopt this bastard syntax? FASM syntax actually offers easy comprehension due to it's simple consistency - that is why it's liked by those who use it. Fuck the politics of the matter. Offer me a reason to change syntax besides - "everyone is going to use it".
Post 25 Oct 2008, 05:42
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 25 Oct 2008, 15:08
bitRAKE wrote:
bogdanontanu, you mean a bunch of old men are getting together to talk about what syntax they are comfortable with.


Yes my body is kind of old... my soul is evn older ... is this something wrong?

I agree that the talks look too much MASM oriented even for my taste. Obviously I do not like MASM or FASM syntax since I have cerated my own assembler instead of using FASM or MASM.

Quote:

We should all thank you for corralling them.


And NO, I did not ask for any kind of thank you. I just provided a kind of "neutral" place for all interested parts to meet.

I also provided an invitation for those who find this interesting.

Quote:

With as frequent as the instruction set changes standard hardly has a meaning.


I think it can have a meaning.

Quote:

It would be more fruitful to discuss how to expand assembly language to make the syntax more extensible, and dragging a ton of legacy crap into the mix taints the brew from the start.


Yes the whole compatible with MASM stuff is indeed a problem but this problem can be discussed and I still think that even IF we do not reach a consensus or a "standard" and the community remains split ... still one can find interesting stuff in such talks.

Quote:

If nothing beyond standardization is being offered then why should anyone adopt this bastard syntax?


I do not say anyone should adopt a certain syntax. I for one would hardly change my syntax for FASM or MASM for that matter.

Just observing different opinions and concepts in ASM world and how we can not logically agree on [] can be useful and instructive Wink

Quote:

FASM syntax actually offers easy comprehension due to it's simple consistency - that is why it's liked by those who use it.


I will not go into extensive criticism of FASM on a FASM board.

My opinion on FASM is clear: It has some weak points and some good points BUT I do prefer my own even if not finished yet Wink

However this does not stop me from being present here and talking about this and keep an open eye for each assembler. Even if you do not care for a specific syntax or an assembler it might be good for ASM in general to try to have some sort of reference point.

Quote:

Fuck the politics of the matter.


I care nothing about "politics" ... I do not even give the above word for politics.

Quote:

Offer me a reason to change syntax besides - "everyone is going to use it".


I have no reason for this change... only you can find one if ever.

Besides I do not think I will "switch" neither to MASM nor to FASM or another assembler.

But maybe some minimal options that are not very important or hard to implement can be harmonized and even if 1% compatible status is met it can still be a first step and maybe of some help.


I have just made an invitation to "talks" that is all....

_________________
"Any intelligent fool can make things bigger,
more complex, and more violent.
It takes a touch of genius -- and a lot of courage --
to move in the opposite direction."
Post 25 Oct 2008, 15:08
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 25 Oct 2008, 16:42
Brand new, independent assemblers are evolved now and then. This try for standardization can help their authors to design them better.

There were talks about new, backward-incompatible FASM 2.0. So again, this standardization can help to make it better.
Post 25 Oct 2008, 16:42
View user's profile Send private message Visit poster's website Reply with quote
drhowarddrfine



Joined: 10 Jul 2007
Posts: 533
drhowarddrfine 25 Oct 2008, 21:14
I'm just blurting this out. My first concern would be how you could standardize syntax for behavior of all/most of the different processors. The only example I can think of would be Intel's FPU instructions vs someone elses FPU set.

I guess it's possible to have similar mov eax,3 instructions, like move 3->r(a) where 'a' could be a variable set somewhere else somehow to account for different number of registers but this could get unwieldy and complicated.
Post 25 Oct 2008, 21:14
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 25 Oct 2008, 21:38
To: drhowarddrfine

The standardization was intended for x86 IA32 assemblers not Intel versus Arm ASM syntax. Maybe later on we could try that Very Happy

Hence the instructions are relatively the same and known with available Intel and AMD manuals but different assembler creators have implemented different syntax rules (including myself).

One simple issue / example is:
Code:
 mov esi,offset my_var ; (MASM) 
 ;versus 
 mov esi,my_var  ;(FASM)
    
in order to get the offset / address of a variable

And the later consequences of:
Code:
 mov ecx,my_var  ; (MASM)  
 ;versus 
 mov ecx,[my_var]  ; (FASM)
    
in order to get the contents at a variable location

We could not agree what is the "correct" syntax from a logical point of view ...each one keeping his own preferences (qed)
Post 25 Oct 2008, 21:38
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 26 Oct 2008, 01:16
bogdanontanu wrote:
Just observing different opinions and concepts in ASM world and how we can not logically agree on [] can be useful and instructive Wink
Hence I shall only observe and refuse to involve myself in the discussion or adoption of a standardization. No doubt it will have some historical significants and comedic value. Laughing

http://www.cartoonstock.com/directory/W/Wheel.asp

Oh, bwt - since when has inconsistancy been logical. Only one bracket syntax is consistent across all instructions and addressing modes. To say otherwise is to express an emotional/historical perspective. Kind of silly to hide behind "logic" when the motivations are otherwise - that is politics.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 26 Oct 2008, 01:16
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 28 Oct 2008, 05:06
Don't we already have asm language standardization called "The C/C++ Language"? Very Happy
Post 28 Oct 2008, 05:06
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 28 Oct 2008, 14:29
Yes, of course that C evolved exactly like an attemp to make a kind of "cpu independent assembler" and if you add OOP to C it becomes C++.

But also if you use "invoke like" syntax in ASM the it looks and behaves almost like C and if you add a few OOP macros then it looks and behaves like C++.

However this move is towards a standardization of ASM while ASM still remains ASM and does not transform itself into another programming language.
Post 28 Oct 2008, 14:29
View user's profile Send private message Visit poster's website Reply with quote
KingDemon



Joined: 16 Oct 2006
Posts: 21
Location: Somewhere in Romania
KingDemon 31 Oct 2008, 10:00
Hi, newbie here...
Just wanted to say that I like the FASM syntax as it is.
And Bogdan, get back to working on that OS of yours! It looks good.
And you should know better than anyone here that politics hurt people.
Post 31 Oct 2008, 10:00
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 01 Nov 2008, 06:41
windwakr wrote:

> FASM syntax is the best, all others should adopt FASM syntax

Agree, but your are shooting into vacuum here Very Happy Better go to the forum of King Hutch and start pressuring Agner Fog, Japheth, and, of course, King Hutch Very Happy

Anyway, a nice challenge:

Code:
 inc [blah]
    



what is supposed to happen ?

FASM: operand size not specified
GAS: operand size not specified

Good Smile But don't celebrate prematurely ...

Code:
 inc dword [blah]
    


what is supposed to happen ?

FASM: OK (increments UINT32 AKA DWORD value)
GAS: operand size not specified !!!

GAS is blind to "dword" if it isn't followed by "ptr" ! Not a bug of course, great free GAS doesn't have any bugs Very Happy

> Gas supports Intel syntax because everybody hates the AT&T syntax.

But this won't help too far if you have C code and as long as GCC can't brew anything except AT&T , WATCOM can't brew any ASM at all, and CC386 is abandoned and has bugs Sad
Post 01 Nov 2008, 06:41
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 01 Nov 2008, 07:04
> Agree, but your are shooting into vacuum here Better go to the forum of King Hutch and start pressuring Agner Fog, Japheth, and, of course, King Hutch

When you grow up with an assembler (i.e. masm/ml) of course you see it as "the best". I've used masm since v1.25 and like it...for certain things.

As far as he brackets/offset thing, it seems to me to be more intuitive to use brackets when you mean 'the contents of' e.g.
Code:
  mov eax,var
;versus
  mov eax,[var]
;but we all have to use
  mov eax,[ebx+esi*4+var]
;instead of
  mov eax,ebx+esi*4+var
    

The thing is, masm doesn't care - "mov eax,var" is the same as "mov eax,[var]"
Post 01 Nov 2008, 07:04
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20416
Location: In your JS exploiting you and your system
revolution 01 Nov 2008, 10:59
sinsi wrote:
The thing is, masm doesn't care - "mov eax,var" is the same as "mov eax,[var]"
It has been a while since I have used MASM (so I might be mistaken here), but I am pretty sure that the above quoted comment is wrong. Because I think MASM would look at the definition of "var" before deciding what code (or error) to generate.

Consider these two possibilities:
Code:
var equ 12345679
mov eax,var    
Code:
var dd ?
mov eax,var    
Post 01 Nov 2008, 10:59
View user's profile Send private message Visit poster's website Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 01 Nov 2008, 12:09
> Agree, but your are shooting into vacuum here. Better go to the forum of
> King Hutch and start pressuring Agner Fog, Japheth, and, of course, King
> Hutch Very Happy

Please don't make such dangerous suggestions! Hutch's forum is clearly "enemy territory". That's the reason why Bogdan has created his sub-forum. But even there you'll have to provide some reasonable backup, just troll talk won't be appreciated too much.
Post 01 Nov 2008, 12:09
View user's profile Send private message Reply with quote
drhowarddrfine



Joined: 10 Jul 2007
Posts: 533
drhowarddrfine 01 Nov 2008, 15:56
Just my two cents:

I, too, like brackets meaning "contents of".
I like instructions reading from left to right, as in mov 3,eax meaning "move 3 to eax". Even better, would be 'mov 3->eax' cause motion by the arrow is easier to read (but harder to type).
Post 01 Nov 2008, 15:56
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 02 Nov 2008, 12:36
Quote:
I like instructions reading from left to right, as in mov 3,eax meaning "move 3 to eax". Even better, would be 'mov 3->eax' cause motion by the arrow is easier to read (but harder to type).

see my argumentation against this in my old article: http://x86asm.net/articles/what-i-dislike-about-gas/index.html
Post 02 Nov 2008, 12:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.