views:

666

answers:

5

I'd like to have a go at learning assembly, and possibly writing my own simple assembler (I recently read an interesting article on how to create an operating system, and quickly realised that a certain familiarity with assembly would help me out a lot here).

The trouble is that although I'm sure I'll have no problems finding articles and guides on assembly language / machine code, I tend to learn by doing, and I'd really like to have a go at executing my code. I figure I have two options:

  • Learn how to create a windows executable
  • Use some sort of virtual machine / emulator

The second option sounds better to me, as it protects me from potentially making stupid mistakes, and will probably more closely resemble the environment I'll be in while writing an OS, but I'm not really sure how to do either.

A: 

Start with some tutorials.

Look at either FASM or MASM.

Noon Silk
+1  A: 

You don't say which processor you are interested in, which is of great importance. However, assuming the intel x86 family, there are quite a few emulators out there which will let you run your code safely on your desktop, such as this. Google for "8086 emulator" for more.

anon
Well I hadn't yet decided, I thought I might have a go on some sort of embedded system, but I figured it doesnt matter that much at this stage as it seems to me the skills and concepts are fairly transferrable between archetectures.
Kragen
Basic concepts yes, but becoming skilled on a particular architecture can take quite a while - I used to be a pretty good Z80 programmer, but even so it took me months to become an average 6502 one. And modern architectures are much more complex than those two.
anon
+3  A: 

Great place to learn windows assembly programming for x86 is legendary Iczelion's tutorials.

You can also find MASM tools here

and if you have the patience, #asm on EFNET

Indeera
+1  A: 

I recommend you learn a RISC assembly instead of CISC; you will have fewer instructions to learn and you can practice building more of the higher-level constructs. I first learned MIPS assembly because it has a great free emulator (SPIM) and textbook, which I unfortunitely forget the name of, but it had an old-school woven binding and was a cream color.

rcampbell
I took a class that taught MIPS assembler and used SPIM. It reminded me a lot of Applesoft Basic (if/then/else, goto, gosub, basic math).
crashmstr
+3  A: 

You might want to read this fantastic :book

bplus
I wish I could give every endorsement of this book much more than a +1
Dinah