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.
Download
| File | Size | Notes |
|---|---|---|
| macOS, Apple silicon | 29 MB | macOS 11 or newer. Open the DMG and drag FX-702P to Applications. Signed and notarized. |
| macOS, Intel | 31 MB | macOS 11 or newer. Signed and notarized. |
| Windows | 27 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. |
| Linux | 31 MB | x86-64. Unpack with tar xzf fx702p-linux-x64.tgz and run fx702p/bin/fx702p. Needs X11, present on any desktop install. |
| fx702p.jar | 1.1 MB | The same emulator without a bundled Java: needs Java 8 or newer. Start it with java -jar fx702p.jar. |
| fx702p-samples.zip | 2 KB | Two sample programs: planet positions and base conversion. |
| fx702p-manual.pdf | 2.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
- Open File: load a .702 file.
- Reload / Reload All: load the last file again, single program or all programs.
- Save / Save As: save the current program.
- Save All / Save All As: save all programs and variables.
- Quit.
Program menu
- Run: run the current program.
- Debug: run it in the debugger, opening the debugger window if needed.
Right-clicking the calculator opens a menu with the same commands.
Display menu
- Original Dot Matrix: the 5×7 dot characters of the FX-702P.
- Readable Font: the same text in a real font, with ≤, ≥, ≠, π, ↑ and the small exponent E drawn as such.
The choice applies to the calculator and to the debugger's source code, and is kept between sessions.
Keyboard
Digits, letters, operators, the arrows, F1 and F2 work as on the FX-702P. The other keys:
| FX-702P key | Keyboard | FX-702P key | Keyboard |
|---|---|---|---|
| EXE | Return | MODE | Ctrl O |
| C | Backspace or Ctrl H | AC | Ctrl C |
| STAT | Ctrl T | STOP | Ctrl S |
| ANS | Ctrl A | CONT | Ctrl Q |
| ↑ (power) | ^ | E (exponent) | Ctrl E |
| F1 / F2 | F1 / 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.
| Button | Shortcut | Action |
|---|---|---|
| Run / Continue | F11 | Run until the end, a breakpoint or a watchpoint; resume a suspended program. |
| Step | F6 | Run the highlighted statement and suspend. |
| Finish loop | F7 | On a NEXT statement, run the rest of the loop and suspend. |
| Suspend | F3 | Suspend the program. |
| End | Ctrl 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 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-702P | In 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
- WRT mode: programs are entered from .702 files.
- Permanent memory: nothing is kept when the emulator quits.
- Program size: the steps left and the full DEFM limits are not computed.
- The 80-character line limit, with automatic removal of spaces.
- Nesting limits of GSB and FOR loops.
- LIST and LIST ALL, TRACE mode, the error in PRT mode.
- LOAD, SAVE, VER, PUT, GET and ROM.
- The FP-10 printer and the FA-2 cassette interface.