tags:

views:

218

answers:

7

Recently I decided that learning assembly would be a good idea, but right now, I'm really overwhelmed by all the material I have read about assembly in forums, here, tutos etc (Some of it is really old) so I would love to have some orientation about the assembly language, how to "compile" etc, I would also like it to be able to run on my CPU, so that i can practice, here are my CPU details from CPU-Z

AMD Athlon 64 3200+

Supported Instructions: MMX(+), 3DNow!(+), SSE(1, 2, 3), x86-64

Note: If possible I want this to be Windows oriented (Does this really matters?)

Thanks in advance.

+8  A: 

I think that one of the best ways to start learning assembly language is to look at the output created by a compiler for a language you're familiar with. For example, if you are familiar with Visual C++, then write some very simple code in C++ and use the integrated debugger to show the assembly language created by the compiler (make sure you're compiling with optimisations off). Write some simple for loops, assignment, arithmetic, etc and see what the created assembly language looks like.

For learning, you don't need to know anything about the instruction set extensions that you've listed in your question. All you need to be concerned about is x86 32-bit instructions. You can learn about 64-bit instructions, MMX, SSE, etc later once you've got the foundations in place.

Once you've got some basic understanding in place, you'll need an assembler. A good, well-supported open source general purpose assembler is nasm.

Greg Hewgill
+2  A: 

I would question whether it's a good idea to jump right into learning x86-64.

Typically, it would be a good idea to start with a "simpler" RISC language (you can get emulaters for a lot of RISC processors) to give you a grounding in assembly basics, and then learn more complex architectures afterwards if you're still keen.

Anon.
x64 looks like the future right? Until we get 128 Bit processors =) Anyway, do you know any resource for learning x64 assembly? For assembly noobs :P
Fladur
My recommendation: *don't*. At least, not at first. Learn MIPS or SPARC first to get your head around assembly, and then go for the more complex architecture.
Anon.
x64 is a fine processor... but it's also incredibly complex and unintuitive.
Andrew McGregor
Indeed. Which is why it's a horrible choice for the first assembly language you learn.
Anon.
+4  A: 

My advice would be to pick a really old 8-bit processor like the 8080, and use a simulator, just to get the basic concepts straight in your head. Frankly, once you know one assembly language, learning another is pretty easy (I know about eight or so), but the first step is the hardest.

anon
Or a new processor that is designed to be programmed in assembler, like say the AVR in an Arduino: http://www.sparkfun.com/commerce/product_info.php?products_id=9284
Andrew McGregor
A: 

You say Windows oriented, but the most simple way to get started is actually to do some oldskool DOS/Command programming in assembly. Give yourself simple assignments like 'Write a program that prints the numbers 1 to 10 to the console' or 'Write a program to read a line off text and reverse it'.

St3fan
How can I test something like that?
Fladur
A: 

You might try reading the Crenshaw tutorial on compilers. I know it seems a little strange, but he is building a minimal little compiler that targets m68k assembly, so you get to see how the programming concepts you are already used to are expressed in a very clear, relatively easy assembly language.

Disadvantage: m68k assembly is not very much like x86 assembly, so you'll have another round of learning to do after your done.

dmckee
A: 

If you want to learn assembler you have to learn how a computer works. And Im not talking about 'this lib in my os is responsible for this and that..' I mean hardware. How a CPU is built, what the ALU is, how memory works, how a program is executeted. That is the first step then you can star learning assembler that is what assembler is all about - controlling all those devices. And if you dont know how it works you cant control it.

I suggest browse for a book about computer technologies/architecture it will save you 100+ hours of google and reading stuff you dont understand.

And the easiest arch to start with i MIPS.

Samuel Wejeus
A: 

You could try looking at some of the documents produced by the Rom Hacking community, aimed at simpler systems. Some of the community's assembly tutorials might be a little easier to swallow, as the intended audience is a bit different. While it's certainly not the bleeding edge of technology, it might hold your interest a little more while learning how older hardware works if you learn about something familiar. Furthermore, some emulators have graphical debugging tools which, depending on your tastes, might be easier to get started with than command-line machine level debuggers. On the other hand, it is also important to consider that emulation and game modification are of dubious legality.

T.R.