flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Why fasm was chosen as the compiler instead of nasm or yasm?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 12 Mar 2025, 12:59
I just started to learn assembly language, and suddenly I wanted to search in the search engine whether there was an operating system developed in pure assembly language. I was surprised that there was such a system as menuetos, which made me more interested in assembly language, and I want to ask a question that may be a little offensive. Is that why fasm was chosen as the compiler for menuetos instead of nasm or yasm?
PS: Because I am Chinese, English is not good, these are translated by the translation software, I do not know whether the translation is accurate, if you do not understand, please forgive me, thank you.
Post 12 Mar 2025, 12:59
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 312
Ville 12 Mar 2025, 13:38
I remember having this conversation in the early years of Menuet and the answer is yes. I selected Fasm because it is written in assembly.
Post 12 Mar 2025, 13:38
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 13 Mar 2025, 03:22
Thank you for your answer, but also want to ask, assembly language development of the assembly compiler and C language development of the assembly compiler which execution efficiency is higher?
Post 13 Mar 2025, 03:22
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4161
Location: vpcmpistri
bitRAKE 13 Mar 2025, 09:46
MR.Z wrote:
also want to ask, assembly language development of the assembly compiler and C language development of the assembly compiler which execution efficiency is higher?
Naturally, the assembly language assembler exceeds the execution efficiency of the C language assembler. Not just in lines of code processed/second, but also in size of code generation. It is kind of apples and oranges comparison though, as they have different goals, imho.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 13 Mar 2025, 09:46
View user's profile Send private message Visit poster's website Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 13 Mar 2025, 12:15
bitRAKE wrote:
MR.Z wrote:
also want to ask, assembly language development of the assembly compiler and C language development of the assembly compiler which execution efficiency is higher?
Naturally, the assembly language assembler exceeds the execution efficiency of the C language assembler. Not just in lines of code processed/second, but also in size of code generation. It is kind of apples and oranges comparison though, as they have different goals, imho.


I agree. FASM is written in pure assembly and compiles itself. I wish there were as many libraries to use as python. This allows you to write code more efficiently while still maintaining extreme execution efficiency. I'm also curious how people remember the assembly instructions and how to use them. Can you teach me?
Post 13 Mar 2025, 12:15
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4161
Location: vpcmpistri
bitRAKE 13 Mar 2025, 18:07
MR.Z wrote:
I'm also curious how people remember the assembly instructions and how to use them. Can you teach me?
There is no secret - it's like anything else - practice. Start from the beginning - the 8086 instructions. They work the same on modern processors. Programs are something like 60% move instructions - it's the details that matter. The community teaches - it is enough to join the process.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 13 Mar 2025, 18:07
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1694
Location: Toronto, Canada
AsmGuru62 13 Mar 2025, 23:08
The best way to learn Assembler is to code something simple at first.
Then more and more complicated.
Post 13 Mar 2025, 23:08
View user's profile Send private message Send e-mail Reply with quote
bzt



Joined: 09 Nov 2018
Posts: 83
bzt 14 Mar 2025, 15:34
MR.Z wrote:
Is that why fasm was chosen as the compiler for menuetos instead of nasm or yasm?
There's another fasm feature that outshines all the competition. Fasm has the best and most sophisticated macro language in the world (if you only consider "normal" assemblers, because it's rewrite, fasmg really pushed macros to the extreme, for example you can alter the target instruction set with macros in fasmg which is far beyond what "normal" assemblers can do.)

MR.Z wrote:
I'm also curious how people remember the assembly instructions and how to use them. Can you teach me?
Fasm has an exceptionally good documentation, start there. It explains the instructions in great detail and gives lots of examples on how to use them.

Another good source is Intel Software Developer Manual Volume 2. It is a bit too technical, but explains where the mnemonic abbreviations came from, which makes it easier to remember the mnemonics. For example: "ADC—Add With Carry", "BSF—Bit Scan Forward", "LEA—Load Effective Address", etc. This would make no sense if you use a software to translate this into Chinese, at least basic English understanding is required because mnemonics are English abbreviations.

Cheers,
bzt
Post 14 Mar 2025, 15:34
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 18 Mar 2025, 08:19
bitRAKE wrote:
MR.Z wrote:
I'm also curious how people remember the assembly instructions and how to use them. Can you teach me?
There is no secret - it's like anything else - practice. Start from the beginning - the 8086 instructions. They work the same on modern processors. Programs are something like 60% move instructions - it's the details that matter. The community teaches - it is enough to join the process.


Ok, thank you for your answer.
Post 18 Mar 2025, 08:19
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 18 Mar 2025, 08:37
bzt wrote:
MR.Z wrote:
Is that why fasm was chosen as the compiler for menuetos instead of nasm or yasm?
There's another fasm feature that outshines all the competition. Fasm has the best and most sophisticated macro language in the world (if you only consider "normal" assemblers, because it's rewrite, fasmg really pushed macros to the extreme, for example you can alter the target instruction set with macros in fasmg which is far beyond what "normal" assemblers can do.)

MR.Z wrote:
I'm also curious how people remember the assembly instructions and how to use them. Can you teach me?
Fasm has an exceptionally good documentation, start there. It explains the instructions in great detail and gives lots of examples on how to use them.

Another good source is Intel Software Developer Manual Volume 2. It is a bit too technical, but explains where the mnemonic abbreviations came from, which makes it easier to remember the mnemonics. For example: "ADC—Add With Carry", "BSF—Bit Scan Forward", "LEA—Load Effective Address", etc. This would make no sense if you use a software to translate this into Chinese, at least basic English understanding is required because mnemonics are English abbreviations.

Cheers,
bzt


Indeed, after translating into Chinese, it becomes difficult to read Chinese, because it is impossible to imagine the scene expressed by the text, and it is impossible to imagine the running track and state of the code. When learning the register, it is too difficult to move the data to the register and then want to see the data in the register but do not know how to show it.
Post 18 Mar 2025, 08:37
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 18 Mar 2025, 08:44
AsmGuru62 wrote:
The best way to learn Assembler is to code something simple at first.
Then more and more complicated.


Indeed, if you practice writing instructions over and over again, your hand should be able to remember them, even if your brain can't.
PS: Chinese does not say "you", why the translation software will add "your", very strange.
Post 18 Mar 2025, 08:44
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4161
Location: vpcmpistri
bitRAKE 18 Mar 2025, 08:56
MR.Z wrote:
Ok, thank you for your answer.
If you want to play with some code, I post a lot on the forum and my github. Learning to read code is important as well. Most AI models can explain small snippets of assembly.

Look at these brief math problems, and you begin to understand.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 18 Mar 2025, 08:56
View user's profile Send private message Visit poster's website Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 26
Mat-Quasar 18 Mar 2025, 09:03
MR.Z wrote:
When learning the register, it is too difficult to move the data to the register and then want to see the data in the register but do not know how to show it.


Use a debugger like x64dbg, then as your step over each line of code, you can observe the value in registers and flags like screenshot attached below:


Description: EAX value is shown in the right pane of x32dbg
Filesize: 51.75 KB
Viewed: 204 Time(s)

x32dbg.png


Post 18 Mar 2025, 09:03
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 18 Mar 2025, 09:14
Mat-Quasar wrote:
MR.Z wrote:
When learning the register, it is too difficult to move the data to the register and then want to see the data in the register but do not know how to show it.


Use a debugger like x64dbg, then as your step over each line of code, you can observe the value in registers and flags like screenshot attached below:


Wow, this looks very professional, and I thought you could print out the contents of the register just like in C using a command like printf().
Post 18 Mar 2025, 09:14
View user's profile Send private message Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 26
Mat-Quasar 18 Mar 2025, 09:29
MR.Z wrote:
...and I thought you could print out the contents of the register just like in C using a command like printf().


Yes, you can do that as well.
Post 18 Mar 2025, 09:29
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 18 Mar 2025, 09:33
Mat-Quasar wrote:
MR.Z wrote:
...and I thought you could print out the contents of the register just like in C using a command like printf().


Yes, you can do that as well.


Sorry, I'm using a translation software that somehow likes to add the English word "you". I think it's easy to misunderstand.
Post 18 Mar 2025, 09:33
View user's profile Send private message Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 26
Mat-Quasar 18 Mar 2025, 09:48
MR.Z wrote:
Mat-Quasar wrote:
MR.Z wrote:
...and I thought you could print out the contents of the register just like in C using a command like printf().


Yes, you can do that as well.


Sorry, I'm using a translation software that somehow likes to add the English word "you". I think it's easy to misunderstand.


No worries, it is common to refer to "you" in English. Same like you, at first, I thought it is impolite to emphasize "you" in English, while in Chinese it is not being emphasized.
Post 18 Mar 2025, 09:48
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4161
Location: vpcmpistri
bitRAKE 18 Mar 2025, 14:07
MR.Z wrote:
Chinese does not say "you", why the translation software will add "your", very strange.
I'm sorry, for my ignorance in this cultural difference. My intent was to be welcoming. We can try another way. Learning happening all around.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 18 Mar 2025, 14:07
View user's profile Send private message Visit poster's website Reply with quote
bzt



Joined: 09 Nov 2018
Posts: 83
bzt 18 Mar 2025, 21:56
MR.Z wrote:
Indeed, after translating into Chinese, it becomes difficult to read Chinese, because it is impossible to imagine the scene expressed by the text, and it is impossible to imagine the running track and state of the code.
That's not what I meant. More along the line:

For example it might seem difficult to remember a mnemonic like "BSF" at first, but if you understand what "Bit Scan Forward" means in English, then it's damn easy.
例如,一开始可能很难记住像“BSF”这样的助记符,但如果你理解“Bit Scan Forward”在英语中的意思(位扫描向前),那么它就非常容易了。

What I was trying to say is, if you copy'n'paste this explanation above into a Chinese translator software as-is, that would translate everything, every single word. But then the explanation would become meaningless, as words inside quotes must be kept in English for the sentence to make sense. This is very common in programming documentations, some words just must not be translated. Like in "mov word [bx], ax", loses meaning if "word" in it gets translated, as "word" in Assembly has a special meaning, different to what generally "word" in English means.

Anyway, I'd suggest for you to learn at least a bit of English. I'm not talking about Tolkien-level linguistics, just learn about 1000 words and phrases or so, a sub-set called programming jargon, that's a must imho. Translators will never get the jargon right, because they are created as general purpose tools. FYI, English isn't my native language either, so I advice this as a fellow foreigner, learn at least the jargon, worth it big time!
Post 18 Mar 2025, 21:56
View user's profile Send private message Reply with quote
MR.Z



Joined: 12 Mar 2025
Posts: 15
MR.Z 19 Mar 2025, 11:57
Mat-Quasar wrote:
MR.Z wrote:
Mat-Quasar wrote:
MR.Z wrote:
...and I thought you could print out the contents of the register just like in C using a command like printf().


Yes, you can do that as well.


Sorry, I'm using a translation software that somehow likes to add the English word "you". I think it's easy to misunderstand.


No worries, it is common to refer to "you" in English. Same like you, at first, I thought it is impolite to emphasize "you" in English, while in Chinese it is not being emphasized.


你确定你不是中国人?因为我觉得你的中文好像学得挺好。
Post 19 Mar 2025, 11:57
View user's profile Send private message 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.