Getting started with Z80/LAB
Z80/LAB is a browser-based Zilog Z80 development environment. Assemble a program, execute it in a WebAssembly emulator, examine CPU and RAM state and save your session to a file. No account or installation is required.
1. Assemble and run a program
- In Assembly workspace, choose Print a message from the Example menu and click Insert example.
- Click Assemble & load. The listing shows generated addresses, bytes and source statements. The program counter is set to the assembled entry address.
- Click Run. The serial terminal should display
Hello from Z80/LAB!. - Try the Alphabet loop example; it prints the first 16 letters of the alphabet.
You can edit the Z80 assembly source directly, open a local .asm file, save the editor contents or download the assembled program as Intel HEX.
2. Debug execution
- Step executes one Z80 instruction. Step source advances to the next mapped source line. It enters subroutine calls; it does not step over them.
- Click a highlighted source line number or a disassembly line to toggle a breakpoint, or enter a hexadecimal address beside Break at.
- Run continues execution; Pause stops it. Reset resets the CPU; loading another program resets the emulator and clears breakpoints.
- CPU state displays main and shadow registers, flags, PC, SP and counters. The Disassembly panel follows PC or can be navigated manually.
- Memory inspector displays bytes in hex and ASCII. Enter a hexadecimal address to navigate, or edit memory using pairs of hex digits.
Source-level debugging requires a current source map. Editing source or executable bytes, or loading a different program, invalidates the map: reassemble to restore source stepping and source breakpoints. Not every data-only source line has an executable breakpoint location.
3. Load programs and use serial I/O
Load program offers prebuilt examples and local Intel HEX, text-hex and raw binary files. For raw .bin files, specify the hexadecimal Binary origin. The Serial terminal displays output from the emulator's virtual ports 00, 01 and 02; its input box lets you send characters to programs expecting terminal input.
The virtual clock can be set to 2, 4, 6 or 8 MHz, or Unlimited. These settings control emulated execution pacing, not the physical speed of a historical Z80 computer.
4. Save and restore a session
- Click Save session to pause the CPU and download a timestamped
.z80sessionfile. - Click Open session and select that file to restore CPU and RAM, assembly source, source map, breakpoints, terminal text and debugger controls.
- The CPU is always paused after restore. Click Run to continue.
Some browsers append a suffix such as .z80session-2 when files share a name. Those files can be selected too; Z80/LAB validates the session contents rather than trusting the filename.
Sessions and source files stay on your device unless you choose to share them. There is no Z80/LAB account, server-side save feature or automatic cloud synchronisation.
5. Shortcuts and assembler syntax
- F5 Run; Shift+F5 Pause; F10 Step instruction.
- F11 or Shift+F10 Step source. On some Macs, press the Fn key with function keys.
- Command+Enter on Mac or Ctrl+Enter elsewhere: Assemble & load.
The integrated assembler is ASM80, not Pasmo. It supports normal Z80 mnemonics, labels, ORG, DB and hexadecimal $ constants; single-file assembly only. INCLUDE and INCBIN are intentionally unsupported. Errors with a known line show a marked source line and a clickable diagnostic.
Compatibility, privacy and limitations
The public release targets Safari 16+ with JavaScript ES modules and WebAssembly. Other modern browsers supporting these features should work, but have not all been independently verified. Z80/LAB runs CPU emulation and assembly locally in the browser: it does not upload your programs or session files.
Source stepping is not subroutine step-over. The browser has not yet completed every external Z80 conformance suite; earlier native-core tests are not a guarantee of full browser conformance. This is an educational/development emulator, not a production hardware replacement.
Original project licence and third-party notices are available in third-party licences. Z80/LAB v1.0.0.