T8 - Translators and facilities: Flashcards
(35 cards)
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