Assembly, Interpreters, Compilers
Assembly, Interpreters, Compilers
High-Level Languages
This is a programming language that uses English and mathematical symbols
like ( %,-,+) in its instruction.
Instruction Code
x = 100
if balance < x:
Print “Insufficient balance”
else:
Print 'Please take your money'
Advantages
1. Closer to the logic of human language - It uses a set of rules that detect
how words and symbols can be put together to form a program. Learning
HLL is not like learning another language. You need to learn vocabulary
and grammar to make sentences. To learn a programming language you
need to learn the commands , syntax and logic similar to vocabulary and
grammar.
2. Code is portable and can be run on different hardware without modification.
Both Machine code and ASM hardware specific
Machine Language
Directly understood by the computer, and it does not need to be translated.
Translator is required to translate the assembly language to machine language
Assembly Language
This is the first step to include programming structure and make machine
language more readable by humans.
It contains a set of symbols and letters.
Translator
Programming language processor that converts a computer program from one
language to another.
It takes a program written in source code and converts into machine language
It discovers and identifies the error during translation.
Types of Translators
1. Compilers
2. Assemblers
3. Interpreters
Compiler
Computer program that translates a program written in a high-level
language to the machine language of a computer.
Assembler
The assembler is used to translate the program written in assembly
language into machine level language
The source program written in the assembly language is given as the input
to the assembler
ASM language -> Assembler -> Machine Code
Source code -> Translator -> Object code
The output generated by assembler is the object code or machine code
understandable by the computer
Examples
FAP -> Fortran Assembly Program
MAP -> Macro Assembly Program
Interpreter
Computer program that simulates a computer that understands a high-level
language.
Executes the code line by line to produce and output data
2. UN HQ
Delegate speaking in Vietnamese at the UN . In order for the
attendees to understand speech there are a number of translators
who provide translation that is transmitted to the attendees
headphones . This translation occurs to real time . Everytime the
delegate speaks, the translators get to work . This type of translation
is the equivalent to interpreting text that is translated line by line as
necessary and results are not used again.
Compiled Code
1. Faster - It's completed faster since the source code is completed prior to
the actual execution.
2. Keep the source code safe - Distribute a program without revealing it inner
workings.
Interpreted Code
1. Flexible - It can be run interactively .
Tools
Little Man Computer