8b Assembly Language Flashcards
What are the two different assembly instruction sets?
RISC
CISC
What are the three main downsides of assembly language?
Hard for humans to understand
Takes longer to program
Processor specific
List 3 advantages of RISC
- Simple circuits so more room for cache and registers
- Each instruction is executed in one clock cycle
- Low energy requirements
Name 2 advantages of CISC
- Has more advanced commands making programming easier
- Makes more efficient use of RAM
Where is RISC used?
Low power devices such as smartwatches
Where is CISC used?
Devices such as laptops and PCs
What are the two types of addressing?
Immediate and Direct
What is immediate addressing?
Data to be used is hard coded e.g. ADD #7
The number 7 is added
What is direct addressing?
Data must first be found from main memory e.g. ADD 7
Doesn’t actually add 7 it adds whatever value is stored in memory address 7
What is used to represent the actual value being used
#
What is the opcode?
The opcode is the instruction saying what is to be done with the data
What is the operand?
The operand is the data/address that is being operated on
What does LDR R0 7 do?
Loads the data stored in memory address 7 into register 0
What does STR R0 7 do?
Stores the data in register 0 to memory address 7
How do you add in AQA assembly?
ADD R0 R1 #7
Adds the number 7 and the data in register 1 together and stores the result in R0
How do you subtract in AQA assembly?
Sub R0 R1 #4
Subtracts the number 4 from R1 and stores the result in R0
How are if statements and loops created in AQA assembly?
Labels: GT, LT, EQ NE
If:
CMP R0 #4
B(label) (name of subroutine)
Subroutine:
(Compares data in R0 with the number 4)
For loops put the subroutine above the comparison