Difference between revisions of "Assembly Language"
Line 4: | Line 4: | ||
*Rm uses the value stored in register m | *Rm uses the value stored in register m | ||
− | ==LDR - Load== | + | ==Op Codes== |
+ | Below is a list of the OpCodes used within your examinations. This table will always be given to you with a small explanation and syntax for each command. | ||
+ | |||
+ | ===LDR - Load=== | ||
This instruction is to load a value stored in memory into a CPU register. | This instruction is to load a value stored in memory into a CPU register. | ||
− | ==STR - Store== | + | ===STR - Store=== |
This instruction is to store a value from a register into memory. | This instruction is to store a value from a register into memory. | ||
− | ==ADD - Add== | + | ===ADD - Add=== |
Operation used to add two numbers together | Operation used to add two numbers together | ||
− | ==SUB - Subtract== | + | ===SUB - Subtract=== |
operation used to subtract two numbers from each other | operation used to subtract two numbers from each other | ||
− | ==MOV - Move== | + | ===MOV - Move=== |
This instruction is to copy a value into a register. | This instruction is to copy a value into a register. | ||
− | ==CMP - Compare== | + | ===CMP - Compare=== |
The CMP instruction compares two operands. It is generally used in conditional execution. | The CMP instruction compares two operands. It is generally used in conditional execution. | ||
− | ==B - Branch== | + | ===B - Branch=== |
− | ==BEQ - Branch If Equal== | + | ===BEQ - Branch If Equal=== |
− | ==BNE - Branch If Not Equal== | + | ===BNE - Branch If Not Equal=== |
− | ==BGT - Branch If Greater Than== | + | ===BGT - Branch If Greater Than=== |
− | ==BLT - Branch If Less Than== | + | ===BLT - Branch If Less Than=== |
− | ==AND - Bitwise And== | + | ===AND - Bitwise And=== |
− | ==ORR - Bitwise Or== | + | ===ORR - Bitwise Or=== |
− | ==EOR - Bitwise Xor== | + | ===EOR - Bitwise Xor=== |
− | ==MVN - Bitwise Not== | + | ===MVN - Bitwise Not=== |
− | ==LSL - Logical Shift Left== | + | ===LSL - Logical Shift Left=== |
− | ==LSR - Logical Shift Right== | + | ===LSR - Logical Shift Right=== |
− | ==HLT - Halt Program== | + | ===HLT - Halt Program=== |
Causes the processor to stop executing your program. | Causes the processor to stop executing your program. |
Revision as of 08:40, 16 June 2017
Contents
- 1 Operands
- 2 Op Codes
- 2.1 LDR - Load
- 2.2 STR - Store
- 2.3 ADD - Add
- 2.4 SUB - Subtract
- 2.5 MOV - Move
- 2.6 CMP - Compare
- 2.7 B - Branch
- 2.8 BEQ - Branch If Equal
- 2.9 BNE - Branch If Not Equal
- 2.10 BGT - Branch If Greater Than
- 2.11 BLT - Branch If Less Than
- 2.12 AND - Bitwise And
- 2.13 ORR - Bitwise Or
- 2.14 EOR - Bitwise Xor
- 2.15 MVN - Bitwise Not
- 2.16 LSL - Logical Shift Left
- 2.17 LSR - Logical Shift Right
- 2.18 HLT - Halt Program
Operands
The operand can be interpreted in two different ways, if it uses:
- # it refers to a specific value to use
- Rm uses the value stored in register m
Op Codes
Below is a list of the OpCodes used within your examinations. This table will always be given to you with a small explanation and syntax for each command.
LDR - Load
This instruction is to load a value stored in memory into a CPU register.
STR - Store
This instruction is to store a value from a register into memory.
ADD - Add
Operation used to add two numbers together
SUB - Subtract
operation used to subtract two numbers from each other
MOV - Move
This instruction is to copy a value into a register.
CMP - Compare
The CMP instruction compares two operands. It is generally used in conditional execution.
B - Branch
BEQ - Branch If Equal
BNE - Branch If Not Equal
BGT - Branch If Greater Than
BLT - Branch If Less Than
AND - Bitwise And
ORR - Bitwise Or
EOR - Bitwise Xor
MVN - Bitwise Not
LSL - Logical Shift Left
LSR - Logical Shift Right
HLT - Halt Program
Causes the processor to stop executing your program.