Tools

AQA Assembly Language Simulator

Write and run programs in the AQA A Level assembly language instruction set. Supports all AQA instructions: LDR, STR, ADD, SUB, MOV, MVN, CMP, AND, ORR, EOR, LSL, LSR, B, BEQ, BNE, BGT, BLT and HALT. Registers R0–R12, Zero and Negative flags displayed. Use PRINT Rn to output register values.

AQA Assembly ; for comments  ·  LABEL:
Output (PRINT Rn)

Use PRINT Rn to output a register value

Registers
R0 0
R1 0
R2 0
R3 0
R4 0
R5 0
R6 0
R7 0
R8 0
R9 0
R10 0
R11 0
R12 0
PC
0
Z flag
0
N flag
0
AQA Instruction Set
LDR Rd, addr – Load mem[addr] → Rd
STR Rd, addr – Store Rd → mem[addr]
ADD Rd, Rn, op2 – Rd = Rn + op2
SUB Rd, Rn, op2 – Rd = Rn − op2
MOV Rd, op2 – Rd = op2
MVN Rd, op2 – Rd = NOT op2
CMP Rn, op2 – Set Z/N flags (Rn − op2)
AND/ORR/EOR Rd,Rn,op2 – Bitwise ops
LSL/LSR Rd,Rn,op2 – Shift left/right
B/BEQ/BNE/BGT/BLT label – Branch
HALT – Stop execution
PRINT Rn – Output Rn (simulator only)

op2 = Rn (register) or #n (immediate value)