1.2.4 Types of Programming Language Flashcards
Procedural Programming
Uses a sequence of instructions which are carried out in a step by step manner.
Procedural Programming disadvantages
- May be inefficient when trying to solve certain problems.
Procedural Programming advantages
- It can be applied to a wide range of problems
- It is easy to write and interpret.
Why is assembly language easier to use than machine code?
It uses mnemonics rather than binary
Why are the commands that assembly language uses processor specific?
It directly interacts with the CPU’s special registers.
Mnemonic: ADD
Add value at given memory address to the value in the accumulator
Mnemonic: SUB
Subtract the value at the given memory address from the value in the accumulator
Mnemonic: STA
Store the value in the accumulator at the given memory address
Mnemonic: LDA
Load the value at the given memory address into the accumulator
Mnemonic: INP
Allow the user to input a value which will be held in the accumulator
Mnemonic: OUT
Outputs the value currently held in the accumulator
Mnemonic: HLT
Stops the program at that line, preventing the rest of the code from executing.
Mnemonic: DAT
Creates a flag with a label at which data is stored
Mnemonic: BRZ
Branches to a given address if the value in the accumulator is zero. This is a conditional branch.
Mnemonic: BRP
Branches to a given address if the value in the accumulator is positive. This is a conditional branch.