flat assembler
Message board for the users of flat assembler.

flat assembler > Programming Language Design > FASM Syntax

Author
Thread Post new topic Reply to topic
jean-lopes



Joined: 29 Sep 2018
Posts: 2
Hello!

I am searching for the complete grammar of the language parsed by FASM, specifically by the intel-8086...

any help is greatly appreciated!

edit: I want to make a toy compiler for the intel-8086 assembly language using the FASM syntax
Post 29 Sep 2018, 15:32
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 442
Location: Belarus
I think, you should be aware that FASM syntax is multilevel: preprocessor stage has somewhat separate syntax considerations compared to the assembly stage.

The tool that supports exactly that syntax already exists and is called FASM. It is free, open-source, fast, small, has rich feature set… Why create another one for compiling exactly the same syntax?
Post 29 Sep 2018, 15:45
View user's profile Send private message Visit poster's website Reply with quote
jean-lopes



Joined: 29 Sep 2018
Posts: 2
DimonSoft wrote:
The tool that supports exactly that syntax already exists and is called FASM. It is free, open-source, fast, small, has rich feature set… Why create another one for compiling exactly the same syntax?


I understand your point, but for me, building toy compilers is really enjoyable and a great way to learn more about the target language.
Post 29 Sep 2018, 15:51
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 442
Location: Belarus
Maybe it’s worth trying to write a toy compiler for the syntax that will suit your needs better than FASM? FASM syntax is supposedly the best among IA-32 assemblers but it’s definitely not an ideal one having its own problems depending on the specifics of your project. Why reimplement something when you can improve it in the same pass?

Not sure if there even exists ready to use grammar. Tomasz might shed some light though.
Post 29 Sep 2018, 16:04
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6981
Location: Kraków, Poland
I have never written the rules as a formal grammar. You can infer them from documentation, though.

Also, as it's been said above, the preprocessor has a separate language and follows different rules.
Post 29 Sep 2018, 19:58
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:  


< 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-2018, Tomasz Grysztar.

Powered by rwasa.