Sign in to follow this  
King_DuckZ

Assembly book for a beginner

Recommended Posts

Hello everyone, I recently decided to seriously study the Assembly language, so I did some quick search on Amazon to see what books I could find. Sadly, I don't have a computer atm, so I hardly have the time to do a search or to examine every seemingly interesting book that popped out on Amazon, hence this post. I already know C++ language, Basic and some scripting languages, so I'm not new to programming. On the other hand, all that my Assembly knowledge allows me to do is to perform basical operations on 16 bits Intel machines. What I'd like to learn is the modern Intel instruction set, along with the problematics and techniques around the Assembly languages in general. If there are OS specific books, I'd prefer Windows related textes. I don't know if there are substantial differencies between 32 and 64 bit Assemblies, but if that's the case, please suggest me where to start from. So, can anyone can point me a good book, or some downloadable e-book?

Share this post


Link to post
Share on other sites
Try the "Write Great Code" series. They give you a nice introduction to assembly from a high level programmer's perspective. They don't really teach you how to write assembly but just make you more aware of what C++ is doing in the background.

Share this post


Link to post
Share on other sites
I am a little curious as to why you would want to 'seriously study' assembly. While it is very handy to have a solid knowledge of what goes on under the hood, you are unlikely to ever use assembly professionally unless you are writing a HAL (Hardware Abstraction Layer), which needless to say, is a very rare thing on modern PCs.

If you are interested in embedded programming, assembly often plays a much larger part, as you do not typically have an OS to insulate you from the hardware, and you have very limited CPU power which may benefit from hand optimisation of the assembly.

Share this post


Link to post
Share on other sites
What about trying an online tutorial first? I wanted to start learning assembly a couple of weeks ago and found this:

http://drpaulcarter.com/pcasm/

You can download the entire tutorial in the form of a pdf. There are also example programs. You just need to download NASM and you can get started writing assembly right away after reading a couple of introductory chapters. I found it excellent. After you learn some basic things you can also download the IA-32 instruction set reference from intel's site and start experimenting with SSE (IMHO you shouldn't bother too much with the x87 floating point instructions, you can just use scalar SSE which is waaay easier).

Share this post


Link to post
Share on other sites
I recommend focusing less on "assembly language", and focusing more on high level computer architecture/organization. Knowledge of how a computer works translates directly to knowledge of assembly language. It is then simply a matter of looking up the instructions for whichever chipset you are using.

I would start with one of these books.

Share this post


Link to post
Share on other sites
i wouldn't waste my money buying a book. just find a little asm tutorial for visual c++ on the net on how to use inline assembly and go from there. if you want to continue, proceed to download the following documents from intel and amd:

Intel 64 and IA-32 Architecture Manuals
AMD64 Architecture Manuals

intel's volumes I, IIA, and IIB are particularly useful for learning all the assembly language instructions. you can also generate assembly when you compile your C++ programs to see what visual studio generates.

then once you have inline assembly down pat, have some fun with MASM.

Share this post


Link to post
Share on other sites
Quote:
Original post by yadango
i wouldn't waste my money buying a book.


I don't recommend buying a book for assembly language either. But I also don't recommend setting out to learn assembly language. Learn the basics of computer organization... any book on the topic will include assembly language.

Share this post


Link to post
Share on other sites
i agree for most people it's a waste to fully learn it. but you never know, the OP may one day fall in love with backend compiler design or something ;). all cs majors should have at least a little experience with asm (and know at least a few general, conditional, and string instructions).

but yeah, i tried for example, sprinkling a little assembly in a Herbert simulator i wrote for the imagine cup. and no matter how hard i tried i couldn't get my assembler code to run faster than what visual studio generated he he he. you have to be really pimp at asm to make it run faster than what a compiler usually generates. you just can't *sprinkle* your code with simple inline assembly and expect it to run faster.

Share this post


Link to post
Share on other sites
Quote:
Original post by yadango
i wouldn't waste my money buying a book. just find a little asm tutorial for visual c++ on the net on how to use inline assembly and go from there. if you want to continue, proceed to download the following documents from intel and amd:

Intel 64 and IA-32 Architecture Manuals
AMD64 Architecture Manuals

intel's volumes I, IIA, and IIB are particularly useful for learning all the assembly language instructions. you can also generate assembly when you compile your C++ programs to see what visual studio generates.

then once you have inline assembly down pat, have some fun with MASM.

And you can also order the hardcopy printed manuals directly from AMD/Intel for free but be warned they are like 1/2 foot high!
p.s. But yeah figure out if a book covers 16 or 32 bit assembly before you waste any money on them since there is a big difference!
I personally used the Norton,Duntemann, and Irvine(covers 32bit assembly) books to learn assembly.


Share this post


Link to post
Share on other sites
cool, thanks, i didn't know that! i think i'll order a copy :). hope i don't have to pay for postage ha ha ha. do you think they'd be pissed off if i ordered all these SKU's?

SKU #253665
SKU #253666
SKU #253667
SKU #253668
SKU #253669
SKU #248966

edit: order sent!

[Edited by - yadango on February 21, 2008 2:49:32 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by yadango
i agree for most people it's a waste to fully learn it. but you never know, the OP may one day fall in love with backend compiler design or something ;). all cs majors should have at least a little experience with asm (and know at least a few general, conditional, and string instructions).


No... knowing any particular flavor of assembly language is pretty much useless, in general. What's important and useful is an understanding of how a computer works--basic architecture of the CPU, memory addressing, caching, etc--and how architecture-specific instruction sets should relate to and affect those things. Once you understand those things, you pretty much know every assembly instruction set ever devised for any architecture. It's just a matter of having a good reference to look up particular instructions.

Learning a particular assembly language without any real reason is almost a complete waste of time. You might soak in some of the architecture ideas in the process, but you'd be better off just skipping the middle man. But I've said that 3 times now, so I'll stop unless I have good reason to say it again. [grin]

Share this post


Link to post
Share on other sites
For those drawing a blank on what they're talking about further up; said SKU's can be found here.

For the record, to paraphrase lolcats -- yes, I 'has' them -- and no I paid nothing to order them (the manuals themselves, not postage -- can't remember about that).

~Shiny

Share this post


Link to post
Share on other sites
Quote:
Original post by King_DuckZ
I decided to get the Assembly Language for Intel Based computers book, thanks everyone for answering.
I will also try the online books you suggested.

Yeah that's probably one of the only books that covers 16 and 32 bit assembly but pretty expensive but worth it since the author does a great job of supporting it via his website and even has some Visual Studio assembly templates for working with masm.
I have the 4th and 5th editions myself.

Share this post


Link to post
Share on other sites
Quote:
Original post by Great_White
you can try Assembly Language for Intel-Based Computers.


Just in case anyone reads this thread and decides to buy this book purely on the recommendations here be warned that this book is not a book purely for Intel assembly language. It is targeted directly at MASM and Windows. If you are interested in programming for Intel Apple Macs for instance this is probably not the book to go for.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this