What is a compiler?

What is a compiler

What is a compiler? A compiler takes computer programs written in a “High level language” and converts them into either “Assembly language” or “Machine code” (more or less the same thing) that a computer is actually able to run.

So, I might say (in C):

#include <stdio.h>
int main ()
{
int x = 1234 ;
int y = 4567 ;
printf ( "%d", x + y ) ;
return 0 ;
}

And the compiler would turn that into instructions for the computer. Something like:

.LC0:
.string "%d"
main:
.cfi_startproc
 pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
 movq %rsp, %rbp
.cfi_def_cfa_register 6
 subq $16, %rsp
 movl $1234, -8(%rbp)
 movl $4567, -4(%rbp)
 movl -8(%rbp), %edx
 movl -4(%rbp), %eax
 addl %edx, %eax
 movl %eax, %esi
 movl $.LC0, %edi
 movl $0, %eax
 call printf
 movl $0, %eax
 leave
.cfi_def_cfa 7, 8
 ret
.cfi_endproc

(That’s assembly language – in reality, the output would be binary machine code that looks more like this…but going on for a page or more!)

00000000: 7f45 4c46 0201 0100 0000 0000 0000 0000 .ELF............
00000010: 0100 3e00 0100 0000 0000 0000 0000 0000 ..>.............
00000020: 0000 0000 0000 0000 b802 0000 0000 0000 ................
00000030: 0000 0000 4000 0000 0000 4000 0d00 0a00 ....@.....@.....
00000040: 5548 89e5 4883 ec10 c745 f8d2 0400 00c7 UH..H....E......
00000050: 45fc d711 0000 8b55 f88b 45fc 01d0 89c6 E......U..E.....
00000060: bf00 0000 00b8 0000 0000 e800 0000 00b8 ................
00000070: 0000 0000 c9c3 2564 0000 4743 433a 2028 ......%d..

As you can see, the high level language “C” code is MUCH shorter and easier to understand than the output of the compiler.

Humans can write Assembly code by themselves – but you typically end up with so much of it – that it rapidly becomes unmanageable.

These days, almost nobody writes assembly code – it’s just easier to let the computer do all of the grunt work.

Search Terms

what is a compiler
what is a compiler in c
what is a compiler in java
what is a compiler in python
what is a compiler in a computer
what is a compiler design
what is a compiler in c language
what is a compiler in hindi
what is a compiler directive
what is a compiler quora
what is a compiler mcq
what is a compiler and interpreter
what is a compiler and how does it work
what is a compiler assembler interpreter
what is a compiler and assembler
what is a compiler and linker
what is a compiler and its function
what is the compiler and run
what is a compiler in a book
what is a linker compiler and interpreter
what is a compiler in a computer system
what is a compiler in programming
what is a compiler in c programming
what is a compiler flag
what is a compiler error in unity
what is a compiler bbc bitesize
what is a compiler bootstrap
what is a compiler in books
what is compiler bacta
what is compiler bacteria
what is compiler backend
what is a difference between compiler and interpreter
what is a compiler in visual basic
what is better compiler or interpreter
what is babel compiler
what is a compiler c++
what is a compiler computer science
what is a compiler compiler
what is a compiler construction
what is a compiler computer
what is a compiler c programming
what is a cross compiler
what is a cross compiler prefix
what is a cobol compiler
what is a css compiler
c is a compiler or interpreter
c what is the compiler
turbo c is a compiler
what is a good c compiler
what is a compiler driver
what is a compiler development
what a compiler does
what is compiler definition
what is compiler design ppt
what is compiler design in hindi
what is compiler design pdf
what is compiler directives in verilog
what is a compiler error
what is a compiler engineer
what is a compiler error in java
what is a compiler example
what is a compiler front end
what is compiler explain its phases with diagram
what is compiler explain
what is cross compiler explain with example
what is cross compiler example
what is a compiler for c++
what is a compiler for python
what is a compiler for computer
what is a fortran compiler
what is a flex compiler
what is compiler function
what is compiler for java
what is compiler for c language
what is a compiler grammar
what is a gcc compiler
what is a good compiler for c++
what is a g++ compiler
what is a gfortran compiler
what is a go compiler
what is gcc compiler in windows
what is git compiler
what is ghs compiler
what is gpp compiler
what is a compiler how does it differ from an interpreter
what is a hybrid compiler
what is compiler.h
what is a self hosting compiler
what is html compiler
what is hotspot compiler
what is hiphop compiler
what is hex compiler
what is a compiler in programming language
what is a compiler interpreter and assembler
what is a compiler in baseball
what is a compiler in citation
what is a compiler java
what is a jit compiler
what is a javascript compiler
what is a js compiler
what is a compiler in java programming
what is compiler javatpoint
what is jit compiler in c#
what is java compiler and interpreter
what is javac compiler
what is a keil compiler
what is keil compiler 8051
what is keil compiler software
what is keil compiler wiki
what is kotlin compiler
what is a compiler language
what is a compiler library
what is a compiler lexer
what is a compiler lex
what is a less compiler
what is a linker compiler
online compiler
d3dcompiler library
what is compiler listing in cobol
what is a compiler macro
what is a compiler microcontroller
what is a compiler means
what is a music compiler
what is a memory compiler
what is a matlab compiler
what is a mib compiler
what is a misery compiler
what is a multipass compiler
what is a compiler in computer science
what is a compiler in computer programming
what is a compiler or interpreter
what is a compiler or translator
what is a optimizing compiler
what is compiler optimization in c
what is compiler of c++
what is compiler options
what is compiler of java
what is compiler of c language
what is compiler of computer
what is a function of compiler
what is a compiler program
what is a compiler python
what is a compiler pdf
what is a compiler preprocessor
what is a compiler pass
what is a pascal compiler
what is a perl compiler
what is a maven-compiler-plugin
what is a query compiler
what is query compiler in dbms
what is qt compiler
what is cross compiler quora
what is qml compiler
what is the purpose of a compiler quizlet
what is compiler design quora
what is the difference between a compiler and an interpreter quizlet
what is a compiler runtime
what is a resource compiler
what is a ruby compiler
what is a roslyn compiler
what is a retargetable compiler
what is compiler-rt
what is matlab compiler runtime
what is rtl compiler
what is rvct compiler
what is rust compiler
what is a compiler switch
what is a compiler software
what is a compiler sdk
what is a sass compiler
what is a silicon compiler
what is a scheme compiler
what is a compiler in swift
what is compiler structure
what is compiler system software
what is compiler
what is a compiler toolchain
what is a compiler technology
what is a compiler token
what is a toy compiler
what is a ts compiler
what is a compiler in the computer
what is compiler tutorial
what is compiler theory
what is compiler tutorialspoint
what is a compiler used for
what is the compiler used in visual studio
what is the compiler used for c#
what is ubuntu compiler
what is compiler in unix
what is compiler loop unrolling
what is a compiler version
what is a verilog compiler
compiler vs interpreted
what is compiler validation
what is vb compiler
what is vectorizing compiler
vbcscompiler
what is vba compiler
what is vhdl compiler
what is a compiler warning
what is a compiler wiki
what is a compiler windows
what is a web compiler
what is compiler with example
what is compiler writing tools
what is compiler with diagram
what is compiler works
what is compiler writing
what is cross compiler with example
what is compiler.xml
what is xjc compiler
what is xcode compiler
what is xlc compiler
what is mplab xc8 compiler
what is a compiler youtube
what is compiler yahoo answers
what is yacc compiler
what is yoyo compiler
1. what is a compiler
1. what is the difference between a compiler and an interpreter
1. what is the input to a compiler called
what is angular 2 compiler
32 bit compiler
3. what is the difference between a compiler and an interpreter
what is 68k compiler
what is a good c compiler for windows 7

Leave a Comment