From code to computation

Status
Not open for further replies.

martixy

Member
Jan 16, 2011
93
6
71
This is probably quite a wide topic, but I'm kinda curious how complex it actually is.

When I type a line of (C) code in some IDE, what exactly happens between that and the obtaining of the result of the execution of said line on say a Sandy Bridge processor.

And I don't mean just a basic outline, I mean every single generic discrete step from compilation, to optimization, machine instruction and logic circuitry and whatnot.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html
That will explain how the code gets to execution. You can write 8 lines of code in assembly and have enough code to boot a machine from disk. Consider looking at how code execution works on a much simpler processor . The 8051 is a cpu still used today but has tons of articles written on how it works internally and there is plenty of assembly code to explain it. Once you understand the simpler cpu then the rest are pretty similar.
 

martixy

Member
Jan 16, 2011
93
6
71
I've started reading, but from the looks of it(and the date at the bottom :D ) it appears to be quite old. Older than NetBurst even. Nice read probably but I question its completeness. At least I didn't find mention of Real Mode anywhere. :D
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
It may be old but even with the latest OS those same things are still going on underneath. The art of assembly language book is still used as a text book by many colleges.
You can get pdf of it here, part of the Yale course on operating systems
http://flint.cs.yale.edu/cs422/index.html

Grab the intel docs from that site too.
 

A5

Diamond Member
Jun 9, 2000
4,902
5
81
You're basically asking us to translate a 4-year CS degree (assuming you focused on compilers or OS the entire time) and multiple graduate-level EE (CompE, EDA/VLSI, and semiconductor physics) degrees into a number of forum posts. :p

Now that I got that out of the way...
Fundamentally, the SB architecture isn't much different than any other superscalar, out-of-order, pipelined CISC architecture since the Pentium Pro (which is typically used as a case study in 4th-year Computer Architecture classes at university, just so you know what we're getting into here).

x86 asm is a nasty business though, and you probably need to learn the basics using RISC asm (most colleges use MIPS architectures to teach this) before even really trying to crack into it.
 

martixy

Member
Jan 16, 2011
93
6
71
Yea, that probably answers the question of how complex it is. :)

But I do have some rudimentary knowledge after all. So it's probably only the last 2 years of CS..
 

lurkmoar

Member
Mar 8, 2008
58
0
0
Yea, that probably answers the question of how complex it is. :)

But I do have some rudimentary knowledge after all. So it's probably only the last 2 years of CS..

i dont want to be (too) rude, but model really answered your question. none of these translation ideas were invented recently, the process is as old as the text he posted, there is nothing different, and what you asked may or may not be how complex it is.

edit: ie these 2 quotes don't go together
Nice read probably but I question its completeness. At least I didn't find mention of Real Mode anywhere.
But I do have some rudimentary knowledge after all.
 
Last edited:

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
I can take part of some if it.

1) You write C code
2) <something>
...
3) Converts in to microinstruction flows
4) Sends the control signals to the circuits
5) Does the computations in CMOS to get the result you wanted to get
6) <something>
...
7) You get the results back on your screen
 
Status
Not open for further replies.