Not only that, the compiler acually changes the code such as unrolling loops and doing hedious things with the CPU registers to make the system faster...
Here, let me show you something from my object dumper
Code: [Select]
Code:
ff7.exe: file format efi-app-ia32ff7.exearchitecture: i386, flags 0x0000010a:EXEC_P, HAS_DEBUG, D_PAGEDstart address 0x000000000040b6a0 Characteristics 0x10f relocations stripped executable line numbers stripped symbols stripped 32 bit words
Now, let me show you how to read this...
"relocations stripped" means that the data to relocate the code to another memory address has been deleted from the file and can not be done.
"executable" means that the program can run.
"line numbers stripped" means that the order the commands have been written have been deleted from the file. The program just runs things "one right after another" anyway so it's not required.
"symbols stripped" means that all filenames, command names, function names, and variable names have been deleted. Computers don't use names to refrence things anyway, just numbers. So to us we call "do damage" and subtract "damage power" from "armor value". To a computer just calls function 27328 and then subtracts variable 37392 from variable 8765.
It doesn't care what anything is called, as long as it's the right one.
"32 bit words" means it's uses 32 bit registers. (It's a 32 bit program)
We learn by experimenting. We use the scientific menthod to find things. it works like this.
1) State an hypothesis on how you think something works.
2) Run the program normally.
3) Observe.
4) Back up your original program/data (This is the control, the one "that works")
5) Change something that tests your hypothesis.
6) Run the program again
7) observe the changes
8) Is your hypothesis correct?
a--- If it is, record your theory and go to step 1
b--- If not, change your hypothesis and go to step 1
The thing is we don't *KNOW* how it works. It's all an educated guess that is supported by experimentation. That's really it.