Source code

From Free Pascal wiki
Jump to: navigation, search

Deutsch (de) English (en) suomi (fi) Bahasa Indonesia (id)

Source Code is the file or group of text files which are processed by a compiler or an assembler and translated into either an executable program or an object module, or into another source file for subsequent translation into an executable program or an object module by another compiler or an assembler.

For the purposes of this system, generally source code is written in Pascal, and is processed by the FPC Pascal Compiler, to produce assembly language source code which is then passed to the assembler, which then produces the executable program.

The FPC Pascal compiler does not directly produce an executable program; instead it translates Pascal code into assembly language, then transfers control to the assembler to translate the generated assembly code into an executable program. This allows the compiler to be relatively similar for all target machines, it does not have to know the object file formats and binary file write routines for every target system, it simply has to know how to generate assembly code.

If this compiler were for another programming language such as Basic, C or Fortran, source code would be written in that language rather than in Pascal.