• ### Announcements

#### Archived

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

# what compiler for assembler?

## Recommended Posts

topsy_sweden    122
what is the most common compiler for assembler?

##### Share on other sites
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 on other sites
Leffe    301
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 on other sites
topsy_sweden    122
pentium 4, but then don''t i also need a linker or something.

##### Share on other sites
Nik02    4348
Doh!
P4 is based on x86

And no, You don't need a linker, assemblers usually do the linking...

[edited by - Nik02 on August 13, 2003 5:22:09 AM]

##### Share on other sites
Snash    122
Exacly, the P4 uses the same instructionsset as the 80386.. NASM is the best choice, I would say

##### Share on other sites
Snash    122
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 on other sites
Xai    1838
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 on other sites
spock    217
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 on other sites
PhiberOptic    128
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 on other sites
Leffe    301
quote:
Original post by Xai
optimizing assembler

I don''t really think optimizing and assembler go well together

##### Share on other sites
noVum    170
Why not? hand-crafted assembly code can be much faster than compiler generated code.

##### Share on other sites
Snash    122
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 on other sites
superpig    1825
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 on other sites
noVum    170
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 on other sites
Xai    1838
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 on other sites
noVum    170
Optimizing Assembler? I never heard about such a thing. AFAIK TASM/NASM/MASM and any inline assembler only translate the mnenomics to byte code.