views:

405

answers:

10

Since programming is essentially hardware interpretation. Are there any books or articles on CPU's or other hardware components that can help in understanding low level programming languages?

Or even hardware books or articles that target programmers?

+1  A: 

Some long time ago I had a book about 386 internals. It helped me understand a lot about real mode and protected mode, virtual memory and others.

Unfortunately I forgot its title, if I were you I'd start trying to understand that kind of stuff (If I do remember the title or find the book I'll post it here).

Edit: I'd start reading the Wikipedia article http://en.wikipedia.org/wiki/Protected_mode and external links from there.

Also I'd like to state that I do find this kind of knowledge important. Even if you don't program that kind of things, it's good to know how programs can be separated from each other (each with its own memory space), how virtual memory works at low level, how do hardware debuggers work. And as a driver programmer (for example) this would be a must have knowledge.

rslite
+1  A: 

Since programming is essentially hardware interpretation.

Not sure I'd completely agree with that. I'd wager that over 99% of programming these days has very little to do with the hardware interactions and a ton more to with leveraging frameworks that abstract the hardware so code is as human-readable and portable as possible.

But anyway... If you're talking really low level, you're probably looking for the technical manuals for the chips you're programming. Those and some assembly books.

Oli
I dunno, there's a stack of embedded development going on out there where you do need to know about the hardware.
Kev
Even high level development (even on a VM!) benefits enormously from an understanding of assembly language, which in turn benefits from an understanding of the real hardware.
rmeador
+1  A: 

I'm showing my age but ...

I started with a book on Z80 assembler, which was great, a nice easy to understand chip. By learning about index registers, it made understanding pointers in C very easy. And when at school I did a microelectronics course which taught about logic gates NAND, AND, OR XOR etc, which makes understanding booleans and a lot of things about binary easy.

I wouldn't say it's essential, and possibly getting less essential every year, but having the picture in my head still helps with understanding things like passing references by value in the Java model.

There are some great kits for playing with digital logic electronics, FPGA etc. for teenagers. I'd buy one and enjoy yourself. Seeing the parts always makes learning hardware more enjoyable than just reading an article.

Nick Fortescue
+1  A: 

Like Oli, I'm not sure I'd agree either. However, if you want a low level perspective on things that isn't tied to any particular hardware architecture, you won't go far wrong with Computer Organisation and Design by Patterson and Hennessey. Get it here:

http://www.amazon.co.uk/Computer-Organization-Design-Revised-Printing/dp/0123706068/ref=sr_1_1?ie=UTF8&s=books&qid=1223295832&sr=1-1

Or here:

http://www.amazon.com/Computer-Organization-Design-Hardware-Interface/dp/0123706068/ref=pd_bbs_1?ie=UTF8&s=books&qid=1223295989&sr=8-1

Bart Read
A: 

I'd recommend "Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold (Amazon link)

Rob Wells
+2  A: 

You might find this helpful (and it's free too).

Onorio Catenacci
That is a very nice piece of pdf :) Thanks
Ólafur Waage
:-) You're welcome.
Onorio Catenacci
Page not found. What was there?
Fedyashev Nikita
@Fedyashev Nikita, I'm not sure this is _exactly_ the same but it's close: http://www.intel.com/design/pentiumii/manuals/243502.htm
Onorio Catenacci
+1  A: 

If you're interested in the low-level, it's probably because you're interested in extracting the maximum performance from your hardware. For x86 I'd highly recommend reading:

  • This excellent article telling you everything you could possibly need to know about RAM and CPU caches.

  • The "Intel Architecture Optimization Manual" (google it and try and figure out the most recent one; it's almost impossible to find on Intel's maze of a website).

timday
+1  A: 

Anything written my M. Morris Mano will help you out. In particular, "Computer System Architecture." In that book he develops hardware concepts and shows how hardware and software meet.

mxg
+1  A: 

I would say one of the best books I think I have read that has to do with programming hardware is Essentials of Computer Architecture, which has excellent information on assembly language without regards to a specific processor.

Matt Pascoe
+1  A: 

I highly recommend these two textbooks.

Computer Organization and Design Second Edition: The Hardware/Software Interface by Paterson & Hennessy. Junior level.

Computer Architecture: A Quantitative Approach Hennessy & Paterson. Senior/grad level, more on designing CPUS.

Brian Carlton