Programming Languages Flashcards
What is a programming language?
A programming language is a set of words or symbols which allows humans to give instructions to computers
What is a computer programme?
Computer programmes are a list of instructions a CPU can use to carry out a particular task
What is the Computer Language Hierarchy?
High Level Language -> Assembly language -> Machine Code (binary/hexadecimal)
Why is assembly language important?
It allows programmer to talk directly to the computer without using binary
Can a computer directly read anything not in machine code?
No, all computer programmes must end up as machine code
What is a Low Level Language?
A language that can directly interact with computer hardware
Why does low level and high level mean?
It refers to the level of abstraction.
Why would you use low level languages?
1) They refer to actual memory locations and have direct access to the processor. 2) Instructions are executed faster, so the speed of processing the programme increases. 3) They use less memory
Are assembly languages and machine code low or high level languages?
They both are low level languages
How is assembly language written?
With mnemonics, e.g. INT, SUB 5 or LDA
What is a mnemonic?
Processor-specific abbreviated text commands, each of which translate to one machine code instruction
Why do we use high level languages?
The programmer does not need knowledge of hardware or the instruction set, so they can focus on the problem they are solving. It is easier and faster to write, understand, change and debug code as high level languages use english-like statements. Produces portable code - can be used on different computers
What is the difference between an interpreter and a compiler?
An interpreter converts instructions line-by-line, but a compiler converts all the instructions at once
What are the advantages of using a compiler over an interpreter?
Once the instructions have been compiled, you don’t need the compiler anymore - no compiler needed on the user’s computer. Interpreters are always needed to run. It’s slower. It can optimise the whole programme
What are the advantages of using an interpreter over a compiler?
Compilers take a long time to start up. End user can’t see the source code. It’s easier to debug
What is an assembler?
It converts assembly code into machine code.
What is the compiled file called?
An executable