Archived

This topic is now archived and is closed to further replies.

what compiler for assembler?

This topic is 5238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
Just to clear up a few terms:
quote:
From FOLDOC
assembly language
(Or "assembly code" A symbolic representation of the machine language of a specific processor.

assembler
A program which converts assembly language into machine code.

compiler
A program that converts another program from some source language (or programming language) to machine language (object code). Some compilers output assembly language which is then converted to machine language by a separate assembler.


So I guess you really wanted to ask: "What is the most common assembler?". To answer that, you have to tell us what processor you''re using.

Share this post


Link to post
Share on other sites
Most assemblers do use a crapload of macros and stuff...

Yeah, I don''t know what processor you are using, or OS for that matter.

My favorite compiler is NASM though. It''s for 80386+ AFAIK.

Share this post


Link to post
Share on other sites
Well, you need a linker if you want to write EXE files, the Assembler assemble the ASM code you written to machine, and normaly stores it in a COM file, but the COM file can be executed like any EXE file.. so no, you don''t need a linker

Share this post


Link to post
Share on other sites
Well, microsoft still have MASM 6.13 if you can find it ... it USED to be the most popular assembler until microsoft orphaned it years ago

Borland has always had a good assembler (TASM) ... which I liked back when I used assembler a little (5 years ago) ... a basic version of it used to come with there C++ programming tools as well - and you could integrate the full vesion quite well

NASM is the open source x86 assembler of choice I think .. and seems to be the only common assembler still being developed today (although I am sure Intel has there own optimizing assembler as part of there C/C++ compiler suite ... I''m not sure what AMD does about it''s instruction sets?)

In fact, the official x86 command codes, we''re simply whatever intel chose to call them in each version of it''s assembler ... since, almost by definition, intel exposed new instructions via it''s assembler and that was the defacto standard for their pnemonics - I assume they still do such ...

Share this post


Link to post
Share on other sites
MASM is not orphaned, although they aren''t selling it separately any more. There''s an updated version (7.x) included with Visual Studio .NET. A version also used to be, and probably still is, included with the DDK.

Share this post


Link to post
Share on other sites
If you are using Visual C++ you could write parts that are not time-critical in c++ and time-critical parts in asm.

try this:



void MyAssemblyFunction()
{
// Put C++ Code here

__asm
{
// Put ASM code here


}

// Put more C++ code here

}



----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

Share this post


Link to post
Share on other sites
Yes, but assemblers now a'' days are much better at optimizing than the old ones.
I would say that there really isn''t any need to write assembly applications, unless you want the size of the application to go down.

Share this post


Link to post
Share on other sites
quote:
Original post by noVum
Why not? hand-crafted assembly code can be much faster than compiler generated code.


*Can* be, in theory, but not often. You''d have to be dealing with a pretty specific construct that confuses the compiler (causing it to generate a ''long way round'') to be able to beat it.

The only *real* needs for Assembler these days are on embedded systems (like the GBA) which run at pretty low speeds but need realtime apps; or for device developers (and even they don''t need to use it often).

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

Share this post


Link to post
Share on other sites
I know that, but what Leffe said is simply wrong
and there ARE situations where assembler can speed up things very much, ignore the Java idiots that keep telling you the opposite.

Share this post


Link to post
Share on other sites
some of you appear to be confused ..

when i said "optimizing assembler" ... i don''t mean HAND OPTIMIZED assembler ... because first of all, why would anyone write in assembler if they weren''t doing there best to optimize the code manually (it''s assumed you are TRYING to optimize if you are using assembler at all) ..

I was talking about an "optimizing assembler" or an assembler which optimizes the generated machine code ... there is absolutely no difference than this and an optimizing compiler ...

in fact, most compilers today optimize at different stages ... the early stages perform high-level optimizations (not available for assembler code) ... and the last stages simple perform machine targeted optimizations - and these may be provided by the CPU vendor in the for of optimizing assembler modules ... although nowdays the lowest level commonly used in C with inline assembly ...

anyway ... I would NEVER use a non-optimizing assembler .. because I know for a fact, a non-optimized assembler program which I could write would be slower than the optimized C equivelent ... because the optimizer can perform evaluations which I simply cannot ... detailed evaluation of loop unrolling tradeoffs, function call overhead, etc ...

Share this post


Link to post
Share on other sites
Optimizing Assembler? I never heard about such a thing. AFAIK TASM/NASM/MASM and any inline assembler only translate the mnenomics to byte code.

Share this post


Link to post
Share on other sites