Programming Fundamentals_Definitions and Languages_links
Programming Fundamentals_Definitions and Languages_links
Fundamentals
DE F I N ITIONS, T R A NSL ATORS A N D P ROG R AMM ING
L A N G UAGES
NICOLA TURING
Assembly Machine
Assembler
language code
Translator: definition
“the systems software used to translate a source program
written in any language other than machine code”
Assembler Interpreter
Compiler
Assembler: Definition
“An assembler program converts assembly language programs into
machine code that the computer can understand and execute.”
Assemblers either store the program directly in the main memory ready
for execution as it is translated, or store the translated program on
storage media (which will then need a loader program to load the stored
program into the main memory to be executed)
Source code
Object code
(written in
Assembler (version of
assembly
machine code)
language)
Interpreter: Definition
“An Interpreter is a computer program that converts the source
code(from a high-level language) into machine code statement by
statement allowing the CPU to execute one line at a time”
High-level Machine
Compiler
language code
Once a program is compiled, the machine code can be used again and
again to perform the same task without re-compilation.
Linking to convert object code
into an executable file
Linking combines the object code with library files that are
required for the execution of the program
Libraries
Executable file
CPU
(.exe)
Source code Preprocessed Object code
Auto-documenter
Apache NetBeans
SharpDevelop (open-source
IDE for the .NET platform)
High and low level
programming languages
Understandable
by human
High-level languages
Assembly languages
Low-level
Machine code
languages
Binary code
Understandable
by machine
Low level languages
Machine languages / code (1st Assembly languages (2nd
generation) generation)
➢Written using hexadecimal or ➢Attempted to make computer
binary code languages readable
➢Many lines of code needed to ➢Programs written as set of
accomplish even a simple task symbolic operation codes
(pneumonics = shortened 2 or 3
➢Different CPUs understand letter words)
different machine languages
➢Programs hard to write and
debug
➢Programs easy to execute from
the computer point of view
To make use of special
hardware
Program in
Assembly LDA means load the value of the
variable into the accumulator
Language to add 2
numbers together ADD means add the value of
another variable to the value
stored in the accumulator
STO means replace the value of the
variable by the value stored in the
accumulator
Advantages and disadvantages
of low-level languages
ADVANTAGES DISADVANTAGES
➢CPU understands machine ➢Difficult & cumbersome to use and
language directly with minimal or no learn
conversion
➢Require highly trained
➢Processor executes low-level programmers to develop and
programs faster as complex maintain programs written in low
instructions already broken down level languages
into smaller simpler ones
➢Correcting errors (debugging) in
➢Stable and rarely crash or low level programs difficult
breakdown once written
➢Machine dependent (ie NOT
portable from one machine to
another) - for example the code for
Intel processors may differ from
Motorola processors
High level languages
➢Enable programmer to focus on ➢Once a programmer has learnt
the problem to be solved the techniques of programming in
any high-level language, these can
➢Require no knowledge of the be transferred to working in other
hardware and instruction set of high-level languages
the computer that will use the
program Programs written in a high level
language are easier to:
➢Portable
➢Read and understand as closer to
➢Can be used on different types of human language
computer (machine independent)
➢Write in shorter time
➢Designed for programmers –
programming statements easier to ➢Debug at the development stage
understand than those written in
low level language ➢Maintain once in use
Categories of high
level languages
1. Third generation languages
2. Fourth generation languages
3. Fifth generation languages
4. Object-oriented languages
5. Web development and scripting languages
Third generation languages
(Structured / procedural languages)
➢Program broken down into Examples of 3rd generation programming languages:
components called modules /
sub-program, each ➢Pascal initially developed as procedural language to help
performing a specific task in teaching & learning of structured programming
➢Control structures used in ➢FORTRAN (FORmula TRANslator) written for use by
problem solving mathematicians, scientists & engineers
➢Flexible ➢COBOL (Common Business-Oriented Language) designed
for common business problems such as inventory control
➢Easier to read systems
➢Easier to modify ➢BASIC (Beginners All-purpose Symbolic Instructional
Code) developed to enable students to easily learn
programming
➢C used for developing system software such as the OS –
provides programmers with powerful features of low level
languages whilst being easy to understand
➢Ada named after first lady programmer, Ada Lovelace.
Used for developing military, industrial and real-time
systems