how a source code of a programe is being converted into object code

please tell me the way of conversion detail, from source code to object code of a programme.:wink:

please give me detailed information about this topic.:wink:

Replies

  • gaurav.bhorkar
    gaurav.bhorkar
    • You write the source code.
    • The compiler translates the your code into binary code (OBJ).
    • The linker extracts the OBJ code from the standard library (for the std. lib. functions like printf you use.
    • The linker links your code with the extracted code and forms the EXE.
    The compiler just translates your source code according to the language rules.
  • Morningdot Hablu
    Morningdot Hablu
    gaurav.bhorkar
    • You write the source code.
    • The compiler translates the your code into binary code (OBJ).
    • The linker extracts the OBJ code from the standard library (for the std. lib. functions like printf you use.
    • The linker links your code with the extracted code and forms the EXE.
    The compiler just translates your source code according to the language rules.
    hi gaurav,
    i think firstly high lable lang source code is converted into assembly source code by the help of compiler and then converted into .obj by using assembler .
    .
    please correct me if i m wrong.
    .
    ๐Ÿ˜’
  • gaurav.bhorkar
    gaurav.bhorkar
    mohit007kumar00
    hi gaurav,
    i think firstly high lable lang source code is converted into assembly source code by the help of compiler and then converted into .obj by using assembler .
    .
    please correct me if i m wrong.
    .
    ๐Ÿ˜’
    Ya assembler is used there. But that process comes under compilation.
  • sushant005
    sushant005
    gaurav.bhorkar
    • You write the source code.
    • The compiler translates the your code into binary code (OBJ).
    • The linker extracts the OBJ code from the standard library (for the std. lib. functions like printf you use.
    • The linker links your code with the extracted code and forms the EXE.
    The compiler just translates your source code according to the language rules.
    Hi gaurav,
    I agree with u.
    But tell me that in all this whole process is there any involvement of preprocessor.๐Ÿ˜
  • gaurav.bhorkar
    gaurav.bhorkar
    sushant005
    Hi gaurav,
    I agree with u.
    But tell me that in all this whole process is there any involvement of preprocessor.๐Ÿ˜
    Look, pre-processor is the first "place" where your source code goes to. The preprocessor converts it to the expanded source code and then sends it to the compiler......and so on.

    Pre-processing, compiling, assembling are all together called as compilation (maybe because they are very related). Even linking is sometimes considered a part of compilation process.
  • simanchal010
    simanchal010
    gaurav.bhorkar
    • You write the source code.
    • The compiler translates the your code into binary code (OBJ).
    • The linker extracts the OBJ code from the standard library (for the std. lib. functions like printf you use.
    • The linker links your code with the extracted code and forms the EXE.
    The compiler just translates your source code according to the language rules.
    gaurav please elaborate the third point.....

    okay gaurav u have complited within the 4 points.......but where is the work of loader?? actually i dont know that much all these topics are new for me.๐Ÿ˜”๐Ÿ˜•
  • gaurav.bhorkar
    gaurav.bhorkar
    simanchal010
    gaurav please elaborate the third point.....
    ๐Ÿ˜•
    Lets take the C language,
    THe standard library available with the compiler is always in binary format and not in source code format.
    The declarations of the standard library functions are written in the header files. Declarations are just there for the compiler to cross-check whether you've passed the correct no. of arguments to a function.

    So, whenever you use printf() in a C program, the linker searches for the printf object code in the std library, extracts it and puts it into your program's object code to make an exe (executable) file.

    okay gaurav u have complited within the 4 points.......but where is the work of loader?? actually i dont know that much all these topics are new for me.:sad:๐Ÿ˜•
    I haven't heard of a loader in a compiler.
    Are you talking of the program loader (which is a component of OS)?
  • sherya mathur
    sherya mathur
    In Computer Science, source code (commonly just source or code) is any collection of statements or declarations written in some Human Readable computer Programming Language. Source code is the mechanism most often used by Programmer to specify the actions to be performed by a computer.
    The source code which constitutes a Computer program - Wikipedia is usually held in one or more Text File, sometimes stored in databases as Stored Procedure and may also appear as Code Snippets printed in books or other media. A large collection of source code files may be organized into a Directory %28File Systems%29, in which case it may also be known as a source tree.
    A computer program's source code is the collection of files needed to convert from human-readable form to some kind of computer-executable form. The source code may be converted into an Executable file by a Compiler, or executed On The Fly from the human readable form with the aid of an Interpreter %28Computing%29.
    The code base of a Programming project is the larger collection of all the source code of all the Computer program - Wikipedia which make up the project.
  • gaurav.bhorkar
    gaurav.bhorkar
    @shreya mathur: We don't need copy-paste from other sources. Please mention the source if you copy.
  • thechamp
    thechamp
    if anyone can elaborate the role of interpreter(particularly and discretely) in compiling of a scource code in C++.
    also, if someone has some experience in developing interpreter for C++, can tell me how do i proceed in developing one. and if there are some scope of improvement in presently available interpretrs which i can work upon.
    thanks
  • anzilkasim
    anzilkasim
    Once you compile the C source program, the compiler covert this source program which has an extension *.c to *.obj, *.exe and *.bak

    Using *.exe file we can run the program, and we can find the object code in *.obj and if any problem happens with the *.c file we can create a new one using the back up file (*.bak).

    anzilkasim
    #-Link-Snipped-#
  • thechamp
    thechamp
    anzilkasim
    Once you compile the C source program, the compiler covert this source program which has an extension *.c to *.obj, *.exe and *.bak

    Using *.exe file we can run the program, and we can find the object code in *.obj and if any problem happens with the *.c file we can create a new one using the back up file (*.bak).

    anzilkasim
    #-Link-Snipped-#
    that did not answer any of my query..
  • anzilkasim
    anzilkasim
    Object files are typically produced by a compiler as a result of processing a source code file. Object files contain compact code, and are often called "binaries". A linker is typically used to generate an executable or library by amalgamating parts of object files together. Object files for embedded systems typically contain nothing but machine code but generally, object files also contain data for use by the code at runtime: relocation information, stack unwinding information, comments, program symbols (names of variables and functions) for linking and/or debugging purposes, and other debugging information.

    Anzil. K
    Project Manager
    #-Link-Snipped-#

You are reading an archived discussion.

Related Posts

I am studying Electrical Btech 2nd year from IIT-R, India. Please suggest me a good book for DC machines. Fitzgerald had just 1 chapter on it which is unable to...
You may have heard of the Connection Machine. This was/is a massively parallel system in which the processors communicate with each other via a comms net, which has a hypercube...
please help me...... need ko ng thesis title or topics na may prototype..... about computer engineering... please...... .๐Ÿ˜•
if we apply 15V VCC to the 741 op-amp, the maximum swing at the output is 13.5v ...where 1.5volt gone......why and how this happens....>>>??/ plz help.....
dear sir, myself laxmi.i m frofessional to power sector.plz soleve my problems.my generator capacity is 12megawatt.in parallel condition with grid when my generation is on 11mw generation mode and import...