6502 WASM Runner — 64 KiB flat RAM

Fast, cycle-agnostic NMOS 6502 execution. No devices, display, timers or memory-mapped I/O are emulated. The runner stops when the program counter reaches the escape address before opcode fetch, on an unsupported opcode, at an optional instruction limit, or when the JavaScript stop flag is observed between WASM chunks.

RAM image: blank 65536 bytes
Apple II Monitor byte code

Compatible with the RetroAppleJS tab 1.2 paste/memory-capture format. Import addressed monitor lines directly into RAM, or export any RAM range as CALL-151 text with eight bytes per line.

Monitor text has not been imported yet.
CPU registers

The first row contains the editable latch values. The second row shows the current CPU state and is read-only. Latch values are preserved while the CPU runs, so the original setup remains available for reuse or modification.

Latch values — editable
CPU values — current / read-only
Idle. Register latch values are ready for a new run.
CPU activity log

Optional diagnostic logging compatible with the JavaScript emulator bootlog record format: 10 bytes per record containing pre-execution PC, opcode/operand, A, X, Y, P and SP. Logging uses single-instruction WASM calls and is therefore intentionally slower than a normal run.

No CPU activity log captured.
Status
Ready.
Programmatic API

await CPU6502.run(config, ramUint8Array) returns { ram, state, reason, instructions }. The input RAM must contain exactly 65,536 bytes. A fresh copy of final RAM is returned.

config propertymeaning
pc,a,x,y,sp,pinitial register values; defaults: PC=0, A/X/Y=0, SP=$FD, P=$24
useResetVectorif true, PC comes from $FFFC/$FFFD and reset-state registers are used
escapeAddressdefault $FF69
escapeEnableddefault true
instructionsPerChunkdefault 1,000,000; may be 100,000,000 for infrequent polling
maxInstructions0/omitted = unlimited
shouldStopoptional callback checked between chunks; ends the run with reason stop
shouldPauseoptional callback checked between chunks; returns the current RAM/register state with reason pause
onProgressoptional callback receiving the current CPU state and executed-instruction count at polling boundaries
yieldBetweenChunksdefault true; lets browser process UI events
activityLogdefault false; when true, captures a JavaScript-emulator-compatible pre-execution CPU activity log
activityLogSizemaximum activity-log records; default 32,768
CPU6502.importMonitorText(text, ram)imports RetroAppleJS/Apple II Monitor deposit lines into a copy of RAM
CPU6502.exportMonitorText(ram, from, to)exports an inclusive RAM range as CALL-151 plus eight-byte monitor lines