T8 - Translators and facilities: Flashcards
Machine code:
first computers,= all programs were written in machine code
Instructions = binary
machine code con
Difficult and time-consuming
Assembly language: use
Device drivers are written here
assembly language function
allows a programmer to create programs more easily than writing in machine code
how assembly code works
Each instruction maps directly to machine code
- translated into machine code before it can be executed
assembly code features
processor-specific
assembly code meaning
Known as a low-level language = each instruction corresponds directly to a machine code instruction
High-level languages
generally have statements that look a bit like English or Maths
high level languages features
- have data structures such as arrays and records
high level language pros
- easier to learn and understand
written faster
easier to understand and debug
high level language works by:
- translation is done by a program which may be either a compiler or an interpreter
Low level languages pros:
run very quickly
require less RAM
used to control and manipulate specific hardware components (device drivers)
compiler
translates a high-level language into machine code
source code
code written by the programmer
object code
the code produced by the compiler
saved to a storage drive and runs whenever required
interpreter
Program that translates a high-level language into machine code
interpreter different to compiler - object code
Unlike a compiler, no object code is produced
interpreter works
- translates each line of code + executes it immediately
interpreter pros
More portable = can run on any computer with an interpreter
what happens if an interpreter reaches a line with syntax error
it stops and displays an error message
compiler translates to produce
object code
interpreter translates and executes
one line at a time
compiled program speed
faster as it is already in machine code
interpreter speed
Takes more time to execute as
each instruction is translated
before it is executed
does compiler always have to be installed
No need for the compiler to be
present when the object code
is run
does the interpreter always have to be installed
interpreter must be
installed to run the program
customers and compilers
Customers who have bought
commercial software cannot
see the code when they buy it
so cannot adapt it
customers and interpreters
Customers can see the source
code so could adapt it or see
how it works
Bytecode
can be interpreted on many different types of processor using an interpreter
bytecode meaning
Some languages, such as Java, are compiled into this intermediate stage
bytecode javascript eg
is interpreted; the source code is included in the web page and then interpreted in the browser
java script use
used in creating web pages,
High-level languages include
Python, VB and Java.
High-level languages need to be
compiled or interpreted before they can be run. Assembly language is a low-level language. It is assembled into machine code before it is run.
Assembly language is a
low-level language.
It is assembled into machine code before it is run.