0% found this document useful (0 votes)
50 views

Assembly, Interpreters, Compilers

This document discusses high-level and low-level programming languages. It defines high-level languages as those that use English-like syntax and are easier for humans to read and write. Examples provided are Java, Python, and C++. Low-level languages like machine code and assembly language require extensive hardware knowledge as they are closer to binary. The document also discusses translators like compilers, assemblers, and interpreters that convert programs between language levels.

Uploaded by

alex
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Assembly, Interpreters, Compilers

This document discusses high-level and low-level programming languages. It defines high-level languages as those that use English-like syntax and are easier for humans to read and write. Examples provided are Java, Python, and C++. Low-level languages like machine code and assembly language require extensive hardware knowledge as they are closer to binary. The document also discusses translators like compilers, assemblers, and interpreters that convert programs between language levels.

Uploaded by

alex
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

High-Level Languages
This is a programming language that uses English and mathematical symbols
like ( %,-,+) in its instruction.

Examples: Java, Python, Fortran, C++


Consider an ATM machine when someone wants to withdraw $100

Instruction Code

x = 100
if balance < x:
Print “Insufficient balance”
else:
Print 'Please take your money'

It's easier to follow than a series of 1,0 in binary code

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

2. Low Level languages


This is a machine oriented language and requires an extensive knowledge of
computer hardware and its configuration.

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.

Assembler is referred to as 2nd generation language since it is no longer used to


write instruction since it uses binary language, but instead uses terms such as
MOV, ADD, SUB, END.

Early computer programs were written in assembly languages; most programs


today don't use assembly but are used often in applications such as Operating
System, electronic devices and technical applications which use precise timing or
optimization of computer resources.

Easier than machine code, assembly language is difficult to understand and


that's why high level languages have been developed.

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

Analogy using human languages


1. A movie made in Asia and characters are speaking in Vietnamese to
market the movie to an international audience.The spoken text
needs to be translated into English translator would sit down and
translate all the text and create subtitles for the movie. Turn on
subtitles. Everything is translated once and can be used as many
times afterwards.

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.

Installing a compiled version of the code.


That is by design
Examples of compiled languages - C++, C, C# Fortran

Interpreted Code
1. Flexible - It can be run interactively .

Test quickly - run a few lines of codes.


Examples of interpreted language - Java , python , Perl, Ruby

Tools
Little Man Computer

You might also like