Cambridge Assembly

Practise assembly for Cambridge AS & A Level Computer Science 9618 and follow each register transfer within a stored-program computer.

Trace how an assembly program changes registers and memory.
Assembly source
Ready
0 memory locations Entry address —
0 of 1 characters consumed
Output from OUT
—
Printable ASCII is shown directly.
Instruction reference
Data movementLDM #n · LDD address · LDI addressLDX address · LDR #n · MOV IX · STO address
Arithmetic and compareADD value/address · SUB value/addressINC ACC/IX · DEC ACC/IX · CMP · CMI
Control and I/OJMP · JPE · JPN · IN · OUT · ENDJPE follows an equal compare; JPN follows a non-equal compare.
Bit manipulationAND · OR · XOR · LSL #n · LSR #n#15 denary · B00001111 binary · &0F hexadecimal
Addressing modesImmediate: value in the instruction · Direct: address in the instructionIndirect: address stored at an address · Indexed: address + IXRelative: target formed from PC + offset; the syllabus example table gives no separate relative opcode.
Von Neumann architecture trace
Ready Tick 0 Instruction 0
FETCH
DECODE
EXECUTE
CPU
data pathway CU control clock
INTERNAL DATA PATH Accumulator ACC Accumulator 0 working value IX Index Register 0 index offset STATUS Status Register — set by compare CLOCK System Clock Tick 0 coordinates each register transfer ALU Arithmetic + logic idle calculates and compares CU Control Unit ready decodes and sends control signals Program Counter PC Program Counter 0 next instruction Memory Address Register MAR Memory address — memory location Memory Data Register MDR Memory data — data or instruction Current Instruction Register CIR Current instruction — instruction being decoded
Address busMAR → RAM
Data busMDR ↔ system
Control busCU ↔ system
I/O deviceIN and OUT use the buses
RAMinstructions + data
share memory
FETCH
PC contains the entry location

The next instruction begins at the address held in PC.

Tick 0before instruction 1
Label and address view
Pass 1 · 0 labels Pass 2 · waiting
Pass 1 records labels; Pass 2 substitutes each label’s address. This lab preserves Cambridge-style mnemonics and addressing modes without showing machine-code encoding.