> I think it involves calling the main function.
What main function? At the bit level, there's no main function.
Printable View
> I think it involves calling the main function.
What main function? At the bit level, there's no main function.
>And what is the name of that program on a windows machine? I would love to look it up...<
What exactly do you mean by "name"? Filename? Internal application name?
>And so what really does it mean to "run" the program? That is, there must be a program that the OS runs to "run" executables-how does it work<
The OS transfers control of the PC to the program. For how long? Depending on how the tasking model of the OS is set up. Maybe a few milliseconds, or perhaps even until the program finishes executing.
>Right now I am working on the parse-end of a compiler.<
Interesting. Good luck! :)
>I think it involves calling the main function.<
Generally speaking, it actually calls a function named _start() which in turn calls main(). Of course, like shtarker said, this is a broad description of what happens.
>What main function? At the bit level, there's no main function.<
Govt, you're a C/C++ coder right? I'm sure you're familar with pointers then. As you should know, a pointer is simply a variable that holds a memory address. Function names in C/C++ are similar - they are an identifier for a section of code. main() doesn't get called (because as you said in the bit level, there is no main), but the code that was previously known as main() does (with a jmp instruction).
Shiro, did u mean a compiler can't compile itself? Then how'd u compile a compiler so that compiler can compile other programs?
>>Shiro, did u mean a compiler can't compile itself? Then how'd u compile a compiler so that compiler can compile other programs?
ummm. . . . .with a compiler?
um..............okok