flat assembler
Message board for the users of flat assembler.

Index > Main > True Assemler or inline assembler?

Author
Thread Post new topic Reply to topic
alf_ua



Joined: 18 Dec 2003
Posts: 11
Location: Ukraine, Lviv
alf_ua 05 Jan 2004, 01:41
Some comilers (like MASM) don't put into binary fie the code you entered in the source file (this is not true assembler).
1. Is FASM doing the same (not including optimization tips which make FASM so good)?
2. If I use inline assembler (for example in FreePascal), do I get what I type or compiler fix code to fit to high level instructions?
3. I know that many programers uses Assembler only inline with GCC (GNU C Compiler), does it really gave the same speed and binary size as manual codeing?

_________________
Codeing is an ART !
Post 05 Jan 2004, 01:41
View user's profile Send private message Reply with quote
Randall Hyde



Joined: 03 Dec 2003
Posts: 57
Randall Hyde 06 Jan 2004, 17:39
alf_ua wrote:
Some comilers (like MASM) don't put into binary fie the code you entered in the source file (this is not true assembler).


This is not the definition of an assembler...
Unless, of course, you're not going to allow any macro assembler out there to be a "true assembler".

Quote:

1. Is FASM doing the same (not including optimization tips which make FASM so good)?


Yes and no. FASM supports straight binary output. FASM also supports PE and ELF output. PE and ELF require the emission of code that doesn't appear in the assembly source file. This does not mean that FASM is not a "true assembler".

By your definition, only DEBUG and its ilk would qualify as a "true assembler".

Quote:

2. If I use inline assembler (for example in FreePascal), do I get what I type or compiler fix code to fit to high level instructions?

Depends on the in-line assembler. GCC, for example, doesn't have any problems at all converting single instructions into multiple instructions at its whim.

Other in-line assemblers only assemble the statements you supply, yet the compiler emits other code before and after.

Quote:

3. I know that many programers uses Assembler only inline with GCC (GNU C Compiler), does it really gave the same speed and binary size as manual codeing?


Depends on how it's written. Almost every HLL with an in-line assembler emits *some* code in addition to the code you write, and there is no way to turn this off. This is the fundamental difference between a HLL with an in-line assembler and a "true assembler". With a true assembler, it is possible to control all the machine instructions that appear in the executable (sans any requirements by the executable format that the linker or some other system must supply).

As FASM provides the ability to specify every executable machine instruction in a source file, it is a "true assembler".
Cheers,
Randy Hyde
Post 06 Jan 2004, 17:39
View user's profile Send private message Visit poster's website Reply with quote
alf_ua



Joined: 18 Dec 2003
Posts: 11
Location: Ukraine, Lviv
alf_ua 06 Jan 2004, 21:06
You explained it to me very clearly. Thanks a lot.

_________________
Codeing is an ART !
Post 06 Jan 2004, 21:06
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.