Compiler Construction



Download 1.49 Mb.
Page9/14
Date15.03.2021
Size1.49 Mb.
#56076
1   ...   6   7   8   9   10   11   12   13   14
Compiler Construction lec 01

High level language


Compared to machine language, the notation used by programming languages is closer to the way humans think about problems.

The compiler can spot some obvious programming mistakes.

Programs written in a high-level language tend to be shorter than equivalent programs written in machine language.

Another advantage of using a high-level level language is that the same program can be compiled to many different machine languages and, hence, be brought to run on many different machines.


Conversion of high level to machine code

Language processing Steps

  • Programs are written in high language pass through series of tools to get desired machine code known as language preprocessing

C language preprocessing

  • The C++ preprocessor copies the contents of the included header files into the source code file, generates macro code, and replaces symbolic constants defined using #define with their values.
  • The expanded source code file produced by the C++ preprocessor is compiled into the assembly language for the platform.
  • The assembler code generated by the compiler is assembled into the object code for the platform.
  • On compilation of source code, the machine code generated for different processors like Intel, AMD, an ARM is different. To make code portable, the source code is first converted to Object Code. It is an intermediary code (similar to machine code) that no processor will understand. At run time, the object code is converted to the machine code of the underlying platform

  • Download 1.49 Mb.

    Share with your friends:
1   ...   6   7   8   9   10   11   12   13   14




The database is protected by copyright ©ininet.org 2024
send message

    Main page