• Advertisement
Sign in to follow this  

assemblers

This topic is 4470 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

I am looking to start on assembly (I do have prior programming knowledge), what would do me best? afaik x86 is the industry standard but would that be good to start with? and with your reccomendation could you point me to an assembler? thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by game mercenary
I am looking to start on assembly (I do have prior programming knowledge), what would do me best? afaik x86 is the industry standard but would that be good to start with? and with your reccomendation could you point me to an assembler?

x86 is an absolutely horrible architecture. Its instruction set stretches back more than thirty years, to a chip which was designed for digital calculators. Rather than starting from scratch when we realized better ways to build microprocessor architectures, Intel decided to go waaay out of their way to maintain compatibility. Opteron chips still contain support for instructions which are virtually useless except for digital calculators. It has a tiny (and hamstrung) register file, an ugly method of performing floating point ops, and SIMD extensions that feel every bit as tacked-on as they are.

With that said, it *is* the industry standard. And since you already know programming, you already know most of what you need to know about assembly in general. I'd suggest you go straight to x86. Have fun! [grin]

Share this post


Link to post
Share on other sites
I agree with both above posters about x86 assembly. You could of course look into MIPS as well. It's used in a few places: PS2, SPARC (I think), and a few others.

tj963

Share this post


Link to post
Share on other sites
Quote:
Original post by game mercenary
am I correct in that assemble programs do not need an OS to run?

I have a p4, so x86 would be my best. thanks


For most applications you always need an OS, don't expect to write a program in x86 expect it to run on windows and linux etc. If you handle all annoying interrupts and misc initializations stuff then you don't need an OS.

Share this post


Link to post
Share on other sites
NASM, FASM, YASM, and MASM are all x86 assemblers.

Share this post


Link to post
Share on other sites
There isn't just one "assembly language," even for the x86 architecture; each individual assembler is likely to have its own unique syntax, conventions, and quirks. For instance, MASM and AT&T syntax are totally different, even though they both assemble to x86 machine code.

I highly recommend Reversing as both an introduction to assembly languages and thinking about low-level programming. As a bonus the book will guide you through a lot of techniques that are useful in debugging and examining higher-level programs as well.

Share this post


Link to post
Share on other sites
You can download the instruction set referance manuals from Intel and AMD on their websites. Generally debuggers have a CPU view that will show you a disassembly of the code being executed so you can understand what the compiler is generating for you. You can embed assembler in a C++ program which is most often what actually makes most sense. Most C++ compilers come with assemblers as well. Originally C compilers were preprocessors that generated assembler. Since you generally can't get the assembler listing any more I assume they no longer work that way, but they still have the assemblers.

Share this post


Link to post
Share on other sites
Quote:
Original post by LilBudyWizer
Since you generally can't get the assembler listing any more I assume they no longer work that way, but they still have the assemblers.


Generating assembler listings from your compiler is pretty easy in both Visual C++ and GCC. For instance, in Visual Studio .Net 2003, right click on a .c or .cpp file in the solution explorer, select properties, expand the C/C++ group of options, select Output Files, and change the value of the Assembler Output option. In Visual C++ 6.0, go to Project, Settings, select a file from the list, and somewhere in the Compiler settings is an option for generating listing files. I also know that it's possible in GCC with a command-line switch but I don't know it off the top of my head.

Share this post


Link to post
Share on other sites
GCC will generate assembly with -S. You can use -masm=att for AT&T syntax (the default) or -masm=intel for Intel syntax.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement