Skip to content
AS & A2 · 9618 §4.2, §4.3, §20.1

ZAK's Assembler & CPU Simulator

Type the assembly language from the syllabus — LDD 200 · ADD #5 · CMP · JPN LOOP · LSL #2 · END — then Step through it and watch the registers, buses and memory do exactly what the Paper 1 fetch–decode–execute question describes. The trace table builds itself. Read the Processor Fundamentals notes alongside.

Loading the assembler…

Example library

35 programs — one for every instruction and addressing mode, plus exam-style traces. Press Examples to search them.

  • Loading & storing 5

    LDM, LDD, STO, LDR, MOV — getting values into ACC and IX and back to memory

  • Arithmetic 5

    ADD, SUB, INC, DEC — with addresses and with immediate values

  • Addressing modes 6

    Immediate, direct, indirect, indexed and relative — the §20.1 set, one program each

  • Compare & jump 5

    CMP, CMI, JPE, JPN, JMP — counted loops, conditions, searching an array

  • Bit manipulation 6

    AND, OR, XOR masks; LSL and LSR shifts; testing, setting and clearing flags

  • Input & output 4

    IN and OUT with ASCII — echo, upper-case, a whole string

  • Exam-style traces 4

    Programs in the style of Paper 1 / Paper 3 trace questions — run and compare with your table

How to write a program here
  • One instruction per line, upper or lower case: LDD 200, ADD #5, STO TOTAL. Comments start with ; or //.
  • Numbers use the syllabus notation: #12 denary, B00001100 binary, &0C hex, 'A' for an ASCII character.
  • Labels: LOOP: LDD COUNT names an instruction; COUNT: 5 names a data location. Or write addresses yourself, exactly like the exam table: 100 LDD 200200: 15.
  • Data without an explicit address is placed straight after the code. Instructions start at address 0 unless you give the first one an address.
  • Addressing modes: LDM #n immediate · LDD n direct · LDI n indirect · LDX n indexed (n + IX) · JMP +2 / LDD -3 relative (A2 §20.1).
  • Word size: bit-manipulation questions are 8-bit in the exam, so AND/OR/XOR/LSL/LSR and the binary displays default to 8 bits; switch to 16-bit for bigger values. ADD/SUB keep exact results and raise the overflow flag when the result would not fit.
  • IN reads the next character from the input box; OUT prints the character whose ASCII code is in ACC. A conditional jump before any CMP is reported as an error, as is executing a data location (missing END).
  • Assemble translates without running, like a real two-pass assembler: every mistake is reported with its line and column — misspelt mnemonics (LDDD, SOT, JPM → “did you mean…”), mnemonics from other assemblers (LDA, BRZ, HLT, MUL), the wrong operand form (LDM 5, LDD #200, LSL 2, MOV IX, ACC), letter O for zero, curly quotes and Unicode minus signs pasted from PDFs, unknown or duplicate labels, jumps into data, stores over code. Warnings flag what an examiner would: unreachable code, a JPE/JPN that can run before any CMP, a CMP whose result is never tested, uninitialised reads, unused labels and short masks. The Listing tab shows the addresses allocated, the addressing mode decoded for each instruction and the symbol table.
Enroll nowOnline classes