Standard AQA Assembly Language Instruction Set
Standard AQA Assembly Language Instruction Set
LDR Rd, <memory Load the value stored in the memory location specified by <memory
ref> ref> into register d.
STR Rd, <memory Store the value that is in register d into the memory location
ref> specified by <memory ref>.
ADD Rd, Rn, Add the value specified in <operand2> to the value in register n and
<operand2> store the result in register d.
SUB Rd, Rn, Subtract the value specified by <operand2> from the value in
<operand2> register n and store the result in register d.
MOV Rd,
<operand2> Copy the value specified by <operand2> into register d.
CMP Rn, Compare the value stored in register n with the value specified by
<operand2> <operand2>.
B <label> Always branch to the instruction at position <label> in the program.
Branch to the instruction at position <label> if the last comparison
met the criterion specified by <condition>. Possible values for
B <condition>
<label> <condition> and their meanings are:
EQ: equal to NE: not equal to
GT: greater than LT: less than
Perform a bitwise logical AND operation between the value in
AND Rd, Rn,
<operand2> register n and the value specified by <operand2> and store the
result in register d.
Perform a bitwise logical OR operation between the value in register
ORR Rd, Rn,
n and the value specified by <operand2> and store the result in
<operand2>
register d.
Perform a bitwise logical XOR (exclusive or) operation between the
EOR Rd, Rn,
<operand2> value in register n and the value specified by <operand2> and store
the result in register d.
MVN Rd, Perform a bitwise logical NOT operation on the value specified by
<operand2> <operand2> and store the result in register d.
LSL Rd, Rn, Logically shift left the value stored in register n by the number of bits
<operand2> specified by <operand2> and store the result in register d.
LSR Rd, Rn, Logically shift right the value stored in register n by the number of
<operand2> bits specified by <operand2> and store the result in register d.
HALT Stops the execution of the program.
Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a label
the identifier of the label is placed after the branch instruction.
Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character is a
# or an R:
• # – use the decimal value specified after the #, eg #25 means use the decimal value 25
• Rm – use the value stored in register m, eg R6 means use the value stored in register 6
The available general-purpose registers that the programmer can use are numbered 0–12