views:

130

answers:

4

I am an electronics student and I have programmed mostly in Assembly. Last night I saw an amazing article that discussed writing a compiler in Ruby. What the author had done was use GCC to peek how the C translates to Assembly. That resonated a lot for me. I could finally see how the C program translated to Assembly.My question/request to the community here is: Could you show me resources that discusses the link between those two better? Should I be reading about compilers? Should I be learning System programming? I dont know what to do. I really want to be better at programming and learn this better. Thank you for your help.

Related:

and others...

A: 

When I took a Computer Organization class they went through the low level details of how processors have come to be, how they process instructions, and how assembly is translated into machine code. Maybe a little lower than what you are looking for, but I think getting a glimpse of how this type of translation occurs from a higher level language to a lower level language is really neat. I think we used this book or one similar: http://www.amazon.com/Computer-Organization-Design-Interface-Architecture/dp/1558606041

AaronLS
I did read about the low level details but I cant seem to make sense of the higher level ones and how they link. I have this huge gap in the knowledge.
kunjaan
+4  A: 

There really are a couple things going on here. First thing you should look at is something like a compilers book. There are several old ones, like the famous Dragon book, that are very good. I just discovered another one today, through, from the same guy who wrote the Art of Assembly Language Programming, on How to Write Great Code. I've only read the sample chapters so far, but it looks very good and also seems to address just what you want without dropping immediately into the wonders of LALR(1) grammars and so on.

"Systems programming" is more about, well, programming systems. In a systems programming ouse, you learn about using various system calls and other stuff to build useful programs. You need to know that too, but it's a different track than "how it happens."

A computer organization book, like the one aaronis refers to, is more about how the program gets from the assembly language level to actual gates and such. It's also called "computer architecture", as the phrase was used when Amdahl, Blaauw, and Brooks invented the term: instruction sets, how they're implemented, and how you make quantitative choices in the design of the things.

Charlie Martin
THank you very much sir. How to Write Great Code vol2 was exactly the kind of information that i was looking for. what books do you suggest for someone who is good in assembly and wants to make transition to HLL?
kunjaan
There are a lot of books around. the C Programming Language isn't bad, and it's a classic. I'm excited about the new Learn To Program from the Pragmatic Programmer guys: http://www.pragprog.com/titles/ltp2/learn-to-program-2nd-edition
Charlie Martin
+3  A: 

The classic reference text on compilers is Aho and Ullman, Principles of Compiler Design, aka the dragon book. The current edition has a few more authors and an updated title....

Compilers: Principles, Techniques, and Tools

RBerteig
A: 

Another good resource is Alan Holub's Compiler Design in C.

Paul Keister