Page 1 of 1

So which ASM tutorials/books/etc are best?

Posted: Wed Aug 01, 2012 12:50 pm
by Hobin
Hi all,

I'm new here, and I'm interested in, well, OS development. That being said, although I have plenty of experience with C, Python, and computer science in general, I lack specific knowledge of (x86) assembly. I've searched around a lot, but I find it very hard to find any *good* books or tutorials on the subject. The 'Art of Assembly' for example, does not as far as I can see really teach assembly: it practically claims that you can do assembly similar to how you'd program in a high-level language, which is not very useful for OS development. Then there are the Intel and AMD manuals, which everyone likes to refer to so much. I'm sure they contain loads of useful information, but if you don't know assembly already (e.g. me), they're rather incomprehensible (at least it appears that way to me). They're more meant to look a few things up rather than teach a complete new subject, if I'm not mistaken. There are a few books to be found (surprisingly few!), but from what I can find they're all about user-level programming with system calls et al.

Basically, what I'm wanting to ask is what you used to learn assembly. Where did you start, and how did you ultimately learn the parts of assembly that allowed you to program lower-level programs? What would you recommend I'd start with? I've also searched the forums, but was unable to find much of anything. Again, this could just be me having a bad day as far as my search-fu is concerned, in which case some pointers to useful threads would of course be appreciated. :D

Thanks,
Robin

Re: So which ASM tutorials/books/etc are best?

Posted: Thu Aug 02, 2012 5:22 am
by Tosi
I learned by looking at instruction set references and writing my own code.
However when I started learning x86 assembly I already knew 6502 and z80 assembler which made it a little easier to learn. There are still a lot of tutorials on 8086 assembler floating around on the internet, but very few 386+ and x86_64 tutorials. You could try writing simple programs and C and then look at the generated assembly using -S.

Re: So which ASM tutorials/books/etc are best?

Posted: Thu Aug 02, 2012 5:48 am
by Combuster
I learned assembly mostly by hacking. Take existing small DOS thingies and investigate what they do, change them. Write pieces of inline assembly. Directly call BIOS interrupts. In the end, learning assembly is only about automating thought patterns to opcodes. You'll have to learn how to program to make sense of all of it.

Re: So which ASM tutorials/books/etc are best?

Posted: Thu Aug 02, 2012 6:50 am
by Congdm
I learn how machines work first, after that, I learn the instructions set from manuals, that is my way of learning machine languages. I suggest you read "Computer Organization" by Carl Hamacher, Zvonko Vranesic and Safwat Zaky (it is my favourite book in my college's library). Or you can go to libraries to find some ancient books on Computer Architecture.

You think "The Art of Assembly" is not useful but have difficult at Intel manual, that is the sign of rushing for OS dev. Take time and don't rush. After reading such books, you will find programming in Assembly is not as hard as you think.