Programming languages Flashcards
What is machine code?
- Machine Code is the set of binary instructions, the CPU uses to perform tasks.
- Machine Code is processor dependant.
What is assembly language?
A low level programming language which is processor-dependant; each instruction is one machine operation
- It uses mnemonics
What are the two types of high level programming languages?
Declarative and Imperative
What are Declarative high level languages?
Give some examples.
-They declare the necessary information to produce the required result.
SQL, CSS
What are Imperative high level languages?
- The program instructions are executed in an order defined by the programmer.
Advantages of using Machine Code and Assembly language over high level languages.
- Executes programs faster than high level
- Doesn’t rely on the compiler to create optimised code
- Low level code is memory efficient due to the lack of abstraction.
Disadvantages of using Machine Code and assembly language over high level languages.
- Difficult to learn to program in a low level language
- High level languages have more training support for learning them.
- low level code is harder to debug
- High level code can be self documenting
- Machine code is processor dependant
- low level code is machine dependant
What are the 2 advantages of using assembly language over machine code
- It uses mnemonics
- The operand uses a decimal or hexadecimal number
Both of these things make assembly language easier to read/write for humans
Give examples of processes that need to use assembly language?
Embedded systems, interrupt handlers, device drivers
What is the relationship between machine code and assembly language?
They have a one to one relationship, one machine code instruction = one assembly language instruction