Lots of basic questions are there in my mind. I need to clear them.
Statement 1: A compiler converts a human-readable codes to object codes, and those are converted to a machine code (executable) by linker.
Am I right here?
At wikipedia, it is written that
Object files are produced by an assembler, compiler, or other language translator, and used as input to the linker.
Question 1: An assembler converts assembly language code (
MOV A, B
ADD C) to machine code. In case of high-level language like C++, that is generated by linker above. So assembler is not used anywhere. So how can it create an object file as written above?
Intermediate code is generated to make the code run on different architectures.
Question 2: Are *.class (bytecode) files created by java compiler object files? If yes, then can we say that the JVM that runs them is a type of linker (however its not creating the executable)?
Question 3: When we compile a C++ program in Turbo C++, we get *.obj files which are the object files. Can we use them to generate the executable in some other architecture?