2.5 - Programming Languages Flashcards
high-level language definition
A computer programming language used to write programs. They need to be translated into machine code through a compiler, interpreter or assembler.
machine code definition
(Object code) it is a low level code that represents how computer hardware and CPUs understand instructions. It is represented by either binary or hexadecimal numbers.
5 commonly used high level languages
Python
Java
C++
Csharp
JavaScript
source code definition
Any program written in a high level language is known as source code
Must be translated into machine code before the computer can understand and execute it
Advantages of machine code
Writing in machine code allows programmers to do things not possible in a high level language
Many high level languages do not allow the programmer to specify items such as the screen refresh rate
Disadvantages of machine code
It is notoriously difficult to write in, understand and debug
Assembly language definition
It sits in between machine code and high level language.
Assembly language uses mnemonics which each directly correspond with a machine code instruction.
LDA
Loads a value from a memory adress
STA
Stores a value in a memory address
ADD
Adds the value held in a memory address to the value held in the accumulator
SUB
Subtracts from the accumulator the value held in a memory address
MOV
Moves the content of one memory address to another
What is Little Man Computer
A simulation of a very basic processor using Vo NEumann Architecture. It uses an example of simple assembly;y language containing a limited set of mnemonic
opcode def
This is the actual instruction
Operand def
This is a value that the instruction uses or manipulates
Translator definition
A translator is a program that converts source code into object code
Compiler def
Takes the source code as a while and translates it into object code all in one go
Advantages of compilers
-run quickly
-can be supplied as an executable file
-they optimise code
Compiler disadvantages
-dont usually spot errors
-must be re compiled every time the program changes
- source code compiled on one platform will not run on another
Interpreter def
Translates source code into object code one instruction at a time.
Advantages of interpreters
-instructions are executed as they are translated
-require less available memory
-errors can be quickly spotted
Disadvantages of interpreters
-run slower
-has to be translated every time it is run
-dont optimise code
IDE stands for..
Integrated development environments
Tools in IDEs
Line numbering
Colour coding
Auto correct
Auto indent
Auto suggestion