Casio FX-702P emulator

An emulator of the Casio FX-702P, a BASIC-programmable pocket computer from 1981, with a symbolic debugger. Written in Java, 2008–2014. A side project, not part of the RPN Classic apps.

The emulator window: an FX-702P with its display and keyboard

Download

FileSizeNotes
macOS, Apple silicon29 MB macOS 11 or newer. Open the DMG and drag FX-702P to Applications. Signed and notarized.
macOS, Intel31 MB macOS 11 or newer. Signed and notarized.
Windows27 MB Windows 10 or 11, x64 (also runs on Arm). Unzip, open the FX702P folder and run FX702P.exe. The build is not signed, so on the first launch Windows shows "Windows protected your PC": click More info, then Run anyway.
Linux31 MB x86-64. Unpack with tar xzf fx702p-linux-x64.tgz and run fx702p/bin/fx702p. Needs X11, present on any desktop install.
fx702p.jar1.1 MB The same emulator without a bundled Java: needs Java 8 or newer. Start it with java -jar fx702p.jar.
fx702p-samples.zip2 KB Two sample programs: planet positions and base conversion.
fx702p-manual.pdf2.1 MB The emulator's 2012 manual (13 pages). This page covers the same ground, plus the Display menu.

Version 1.1.1. The macOS, Windows and Linux packages include their own Java runtime; nothing else needs installing. Tested on macOS 26 (both builds), Windows 11 and Debian 12.

Sources: github.com/pmeheut/fx702p. Licence: BSD-style, © Pascal Meheut.

The FX-702P

Released by Casio in 1981, one of the first handheld computers programmable in BASIC, after the Sharp PC-1211. It holds up to 10 programs at once, P0 to P9, up to 226 numeric variables and one string variable, $. Casio's original manual is here (PDF); see also Wikipedia. The emulator follows the original manual; this page covers what the emulator adds and what it lacks.

The main window

A copy of the FX-702P. Click the keys to press them, or type on the computer's keyboard.

File menu

Program menu

Right-clicking the calculator opens a menu with the same commands.

Display menu

The choice applies to the calculator and to the debugger's source code, and is kept between sessions.

The calculator display in Readable Font mode, showing a string with ≤, ≥ and ≠ signs and the value of π

Keyboard

Digits, letters, operators, the arrows, F1 and F2 work as on the FX-702P. The other keys:

FX-702P keyKeyboardFX-702P keyKeyboard
EXEReturnMODECtrl O
CBackspace or Ctrl HACCtrl C
STATCtrl TSTOPCtrl S
ANSCtrl ACONTCtrl Q
↑ (power)^E (exponent)Ctrl E
F1 / F2F1 / F2, or Ctrl Y / Ctrl Z⇦ / ⇨← / →, or Ctrl B / Ctrl F
≤ / ≥ / ≠{ / } / ~, or Ctrl L / Ctrl G / Ctrl DπCtrl P

Hovering over one of these keys shows its shortcut. Menu shortcuts are shown in the menus.

Debugger

On the real machine, debugging meant TRACE mode and extra PRT statements. The emulator has a symbolic debugger: it shows the source with the current statement, takes several breakpoints, shows the variables and can stop when one changes, and shows the statistics registers (CNT, MX, MY, SX, SY, SX2, SY2, SXY) and can stop on a statistics operation.

The emulator next to the debugger window, which shows the source code of a program, the current statement and the watched variables
The planet-positions program stopped at an INP statement. Breakpoints are in red; the current statement is in blue, and the current part of a multi-part statement (INP, PRT) in purple.
ButtonShortcutAction
Run / ContinueF11Run until the end, a breakpoint or a watchpoint; resume a suspended program.
StepF6Run the highlighted statement and suspend.
Finish loopF7On a NEXT statement, run the rest of the loop and suspend.
SuspendF3Suspend the program.
EndCtrl F2 (⌘ F2 on macOS)End the program.

The shortcuts are Eclipse's. Other keys go to the calculator, so INP statements can be answered without leaving the debugger. The Speed slider sets the speed: Normal is close to a real FX-702P, Fast is as fast as the computer allows.

Double-click a statement to set or remove a breakpoint; the debugger's right-click menu also has Set Breakpoint, Remove Breakpoint and Remove All Breakpoints, and the File menu commands.

Variables and watchpoints

Type a variable name and click Watch, or Watch A to Z and $ for all the standard variables. Watched variables are updated live as calculations or programs run. Tick Watchpoint to stop the program as soon as that variable changes. Remove stops watching the selected variable.

The debugger's variables panel, with annotations on the Watch, Watch A to Z and $, Remove and Watchpoint controls

The statistics registers are in a pane below, hidden by default: drag the separator up to show it. Tick Stat Watchpoint to stop after each statistics operation.

Program files

Programs are written in a text editor, since WRT mode (mode 1) is not implemented, and saved as .702 files. As on the FX-702P's cassettes, a file holds either one program or all programs and variables.

One program

BASIC lines in ascending order, upper-case only, as on the machine. Roots of a quadratic:

10 INP "A",A,"B",B,"C",C:D=B*B-4*A*C:PRT "D=";D:IF D<0 THEN 10
20 PRT (SQR D-B)/A/2,(-B-SQR D)/A/2:GOTO 10

Variables can be set before the program, and a line starting with //, /* or \* is a comment:

A=1
B=78
// game setup
1 WAIT 0:PRT "START"
2 A=INT(RAN#*600+900:T=INT(RAN#*9+25

All programs and variables

The same, with a header naming the file, a line P0 to P9 before each program, and an optional password:

All programs: "UTILS2"
  P0
Password: "0"
1 INP "A",A,"B",B,"N",F:X=A:GSB 10:E=Y:D=(B-A)/F/2
2 FOR I=1 TO F:X=X+D:GSB 10:E=E+Y*4:X=X+D:GSB 10:E=E+Y*2:NEXT I:Y=B
3 GSB 10:E=E-Y:PRT "I=";D*E/3:GOTO 1
15 RET
  P1
  P2
…
  P9

When the emulator saves a file it can add the breakpoints and watchpoints at the end, in a text form that is not meant to be edited by hand.

Special characters

FX-702PIn a .702 file
≤<= or \<
≥>= or \>
≠<> or \=
πPI, p, \p or \P
e (exponent)e, \e or \E; E alone works inside a number

Not implemented