SearchA-ZC › Casio fx-7000G

Casio fx-7000G

1985 Original · from-scratch JavaScript Online

This is a browser build of the Casio fx-7000G, the world's first graphing calculator (1985). It boots to its RUN screen showing 0 on the 96×64 dot-matrix LCD, ready for scientific calculation, and can plot built-in functions on that dot matrix in GRAPH mode. The Casio / Hitachi HD61913 controller's mask ROM has never been dumped and is undocumented, so a chip-level core is infeasible; instead the whole calculator - keyboard, registers, RUN-mode arithmetic and GRAPH-mode plotting - is a functional model written from scratch in JavaScript, with no wasm and no vendor ROM.

Because the loop is ours, the model plugs into the shared debugger: the calculator is driven by a real byte-ROM microprogram (an idle key-scan loop, keycode dispatch and one handler per key), so you can single-step it, read and write the registers and the 1 KB RAM (dot-matrix VRAM + numeric registers), disassemble the microcode, and set breakpoints and RAM write-watchpoints. Type on the on-screen fx-7000G keyboard or your physical keyboard (Enter = EXE, Esc = AC, g = Graph). For a graph, press Graph then a function key (sin, cos, tan, log, ln, √, x², 1/x).

Runs on: Web browser

Casio fx-7000G Online Emulator

Play Casio fx-7000G using JavaScript directly in your browser.

Configurations

ConfigurationEmulatorMachineOSLegal
Casio fx-7000GCasio fx-7000Gfx-7000GgreyOpen ⛶

Machines emulated

Chips

Notes

Embedding

There is no upstream runtime and no ROM to vendor: the Casio fx-7000G is modelled from scratch in JavaScript. The Hitachi HD61913 / Casio custom 4-bit BCD calculator controller in the real machine has an on-chip mask ROM that has never been dumped and is undocumented, so a chip-level core is infeasible. Instead the whole calculator - keyboard, registers, RUN-mode arithmetic and GRAPH-mode plotting on the 96x64 dot LCD - is a functional model, but one driven by a real, steppable microprogram. One plain-global script loads the core:

// the fx-7000G functional core + its microprogram ROM
<script src="fx7000g-core.js"></script>   // window.FX7000G() -> the machine

Boot. Construct the machine (it resets to the RUN screen showing 0), then paint the 96x64 dot-matrix framebuffer each frame and run a pausable / instruction-steppable / breakpointed / watchpointed loop:

var M = FX7000G();          // resets to RUN, LCD shows 0
(function loop(){
  for (var i=0; i<budget; i++) M.step();  // one Casio-fx micro-op each
  render();                        // read the VRAM bytes -> canvas dots
  requestAnimationFrame(loop);
})();

The machine is ordinary objects - no wasm heap - so the debugger reaches every byte directly:

MemberKindWhat it does
M.step()methodFetch, decode and execute exactly one Casio-fx micro-op, advancing PC. The single-step primitive.
M.stobjectLive architectural state: pc, sp, key, mode, op, flags, and the numeric working values X, ACC, ans.
M.romByte(a)methodRead a microprogram ROM byte (side-effect free) for the hex / disassembly views.
M.peek/poke(a,v)methodRead/write a RAM byte with no side effects - the debugger's memory + watchpoint surface. RAM 0x000-0x2FF is the 96x64 dot-matrix VRAM.
M.press(kc) / M.release()methodLatch a key by fx-7000G keycode - how both the on-screen keyboard and the physical keyboard inject keys.

Debugger integration

The plug-in (fx-7000g-debug.js) reads the live core from window.EMU_BOOT and calls EmuKit.defineMachine with a transport, the calculator register set and the memory. The machine's microprogram is a new instruction format, so a disassembler ships as /debugger/src/cpus/casio-fx.js.

The Casio-fx decoder. The calculator's key-scan idle loop, the keycode dispatch and every per-key handler routine are a real linear microprogram held in a byte ROM. The decoder is a flat opcode table: a variable-length encoding of an opcode byte plus 0-2 operand bytes (e.g. DIGIT n, OPSET +, FUNC sin, PLOT sin, JKEY $addr, DISP, DONE). These are mid-level "macro" micro-ops - one calculator primitive each - exactly the way a real calculator mask ROM sequences its keyboard handlers. Any unknown byte disassembles to .op $xx.

What was customised for the debugger. The core is authored to be inspected: the run loop is ours, single-step is M.step() (one micro-op), and reset boots straight to the RUN 0 screen. Between keystrokes the PC genuinely cycles the idle scan loop (NOP / JKEY / JMP), so stepping is always live; pressing a key latches a keycode that the DISP micro-op turns into a jump to that key's handler. Breakpoints are a host-side Set of PC addresses: when any are set the loop steps one micro-op at a time and compares PC (put one on a handler entry to trap a specific key). Write watchpoints sample the watched RAM bytes after each stepped micro-op and halt on a change, so a write anywhere on the RAM bus - a dot plotted into VRAM, or a numeric register updated - trips them. The numeric working registers X/ACC/Ans are IEEE doubles projected into RAM at 0x300 each step (byte-watchable) and shown truncated to their integer part in the register window.

Architecture

The Casio fx-7000G (1985) is the world's first graphing calculator: a 96x64 dot-matrix LCD scientific calculator with RUN, WRT (program) and GRAPH modes and built-in function graphing.

  • Controller - a Hitachi HD61913 / Casio custom 4-bit BCD calculator microcontroller with mask ROM and internal RAM. The ROM is undumped and undocumented, so this core is a functional model rather than a chip-level one.
  • Display - a 96x64 dot-matrix LCD. Here it is a 768-byte framebuffer (12 bytes per row x 64 rows) at RAM 0x000; text is drawn with a 5x7 font, graphs by plotting Y = f(x) per column across the 96 columns with axes.
  • RUN mode - scientific calculation: digit entry, the four operations plus power, and the direct scientific functions (sin/cos/tan in degrees, log, ln, √, x², 1/x, 10ˣ, eˣ), evaluated on EXE.
  • GRAPH mode - the landmark feature: press Graph then a function key to instantly plot that built-in function over the dot matrix. The core arms a GRAPH flag; the next function key runs a PLOT micro-op instead of applying the function to X.
  • Microprogram - the modelled Casio-fx controller runs a byte-ROM microprogram: an idle key-scan loop, a keycode-indexed dispatch, and one short handler routine per key. This is what makes the functional model a clear, fully steppable debugging target.

Every part is a plain JavaScript object, which is what makes the fx-7000G a clear, fully steppable debugging target in the browser.