You are on page 1of 35

MACHINE LANGUAGE

COMPILERS AND INTERPRETERS

Group 2
Program

Is a set of instructions that tells the


computer what to do in order to come up
with a solution in a particular problem.
Programs are written
using a

Programming
Language
Is a formal language designed to
communicate instructions to the
computer
Low level languages
High level languages

2 major types of programming languages


Low level languages

Machine oriented and require


extensive knowledge of computer
hardware and its configuration
Low level languages

Machine Language
Assembly Language
Machine Language
(Machine Code)

Is the only language that is directly


understood by the computer, and it
does not need to be translated
100010011110101001010001
100101011111101

All instructions uses binary notation


and are written as string of ones and
zeroes.
100010011110101001010001
100101011111101
For a Machine it is very easy to
understand!
Human it is very difficult!!!
of
o n ge
ti a
a
r g u
e
n la n
e
G ne
2 chi
nd

a
m
Assembly language

Is introduced to make machine


language more readable to
human
Assembly language

Has a set of symbols and letters


Move
Add
Sub Assembler
end

translator
Assembly language

Most programmers today dont use


assembly language very often
High level language

Is a programming language that uses


English and Mathematical symbols in
its instructions. Like +, -, % and many
others
High level language

Examples are C++, Java, Python,


Fortran
g e:
a n t a
Ad v

High level language

- Are much closer to the logic of human language


- Dictates how the words can be put together to form
a program.
High level Vocabulary
language Grammar

Command, Syntax and Logic


ge:
nt a
ndA dva
2
High level language

- The code of most High level languages is portable


and the same code can run on different hardware
Machine Code or Assembly language

CODE

it needs modification to run on another


computer
High level language

CODE

Can run on multiple system without


modification
Apple (MacOS) Windows OS

CODE

However modifications to code and


high level languages maybe necessary
because of the operating system
Compiler
Interpreter

High level language


Compiler

Computer program that translates a program


written in a high level language to the
machine language of a computer
High level program or source code

Machine
Source Code Compiler
Language

Run
input Output
Program
High level program or source code

Machine
Source Code Compiler
Language
EXE

Run
input Output
Program
High level program or source code

Machine
Source Code Compiler
Language
EXE

Run
input Output
Program
High level program or source code

Machine
Source Code Compiler
Language
EXE
EXE
EXE
EXE
Run
input Output
Program
Interpreter

Computer program that simulates a computer


that understands a high level language.
Interpreter

Source Code

interpreter

input Output
Compiler FASTER

Interpreter More flexible


Compiler It does not reveal the
original source code

Interpreter Doesnt need compiling to test


a program
When you install a software on your PC

Software
Compiled version
of source code
Example of Compiled Languages

C++ COBOL Fortran

C++ COBOL Fortran


Example of Interpreted Languages

Java Pearl Python

Java Pearl Fortran

You might also like