Est. 1985 Beginner

Casio 1st-gen BASIC

The keystroke-entered program language of Casio's first-generation graphing and programmable calculators (fx-7000G and fx-4000P, 1985, through the fx-7700GE of the mid-1990s): single-letter memories, Lbl/Goto jumps, Isz/Dsz count jumps and the ⇒ conditional.

Created by Casio Computer Co., Ltd.

Paradigm Procedural (unstructured: labels and jumps, no block structure)
Typing Untyped numeric memories A-Z; no declarations, no user-defined string variables
First Appeared 1985
Latest Version No version numbers of its own: it is the built-in program mode of each calculator model; the first graphing generation ended with the Icon Menu Power Graphic models (fx-7700GE, around 1993-94) before the CFX-9850G generation of 1996

Casio 1st-gen BASIC is the encyclopedia’s name for the program language of Casio’s first generation of graphing calculators, the fx-7000G of 1985 and the models that followed it up to the mid-1990s, together with sibling programmable scientifics such as the fx-4000P. It is a tiny, formula-centred language. Programs are keyed in one token at a time, data lives in 26 single-letter memories, and all control flow is built from numbered labels, jumps and a single “if true, do the next statement” arrow. Later Casio BASIC grew out of it, and much of the later language still uses its syntax.

A note on the name and the date

Casio never called this language “BASIC”. The fx-7000G manual refers only to the calculator’s “program” feature and “program commands”. The name comes from a 99 Bottles of Beer entry submitted on 18 November 2011 by MSS Software & Services, titled Casio 1st-gen BASIC, whose comment says the code “should work in all 1st generation CASIO calculators” and which links to the fx-7700GE manual. “First generation” matches how Wikipedia’s article on Casio graphic calculators groups the original series (1985), the Power Graphic series (1990) and the Icon Menu Power Graphic series (around 1993).

The encyclopedia’s master list dates the language to 1981. That year is not supported. In 1981 Casio launched the FX-602P, a keystroke programmable calculator, and the FX-702P, a pocket computer with a conventional line-numbered BASIC, but neither runs the language described here. The earliest documented form of this language is on the fx-7000G, which Casio’s own history of its calculator business lists as launched in 1985. This page uses 1985.

History and origins

Casio had been selling programmable calculators for years before the fx-7000G. The FX-602P series (1981) was programmed by recording keystrokes, with labels LBL0-LBL9, GOTO and a decrement-and-skip-on-zero DSZ. According to Wikipedia, the fx-7000G’s language is tokenized in a way “similar to the earlier FX-602P”. The difference is that fx-7000G programs are written as readable formulas and statements on a dot-matrix screen instead of opaque key codes.

The fx-7000G (1985) is widely described as the first graphing calculator available to the public, and Casio itself calls it “the world’s first graphing scientific calculator”. Its manual gives the programming model:

  • 422 steps of program memory shared among 10 program areas, P0 to P9.
  • 26 memories, A to Z, which can be expanded by giving up program steps (Wikipedia gives a maximum of 78 memories).
  • Programs run from the Prog key in RUN mode and are entered in WRT mode.

The fx-4000P, a non-graphing programmable scientific marketed in France by July 1985, uses the same command vocabulary with 550 steps across Prog 0-9. A 2022 retro review of the fx-4000P describes that command set, together with the fx-7000G and fx-6300G, as providing “a base for future Casio programming and later graphing calculators”.

Design philosophy

The language is an extension of the calculator’s manual operation, not a separate programming system. The fx-7000G manual explains programs as “based upon manual computations” and builds the first example by typing the same keystrokes the user would press by hand, adding only ? to ask for input and ◢ to show a result.

Three constraints shape everything:

  • Memory is measured in steps. Every command is a single token, so Goto or sin costs one step, and the manual gives a step count for each example. Saving steps is the main concern.
  • Everything is global. The 26 memories are shared by every program area, so subroutines communicate through memories and through Ans.
  • Control flow is jumps only. There are no loops or If blocks. Repetition and choice are built from labels.

Key features

Statements and separators

Statements are separated by : (continue), a newline, or ◢ (the “Disp” command, which stops, shows the current result or text, and waits for EXE). Assignment runs left to right with →:

?→A:2×√3×A²◢

That line, taken from the manual’s first example, reads a value into memory A and displays the surface area of a regular octahedron with side A.

Jumps

The fx-7000G manual lists three kinds of jump command:

KindSyntaxBehaviour
UnconditionalLbl n, Goto n (n = 0-9)Jump to the matching label in the same program area
Conditionalleft relop right ⇒ statementIf true, run the statement after ⇒; if false, skip to the next :, newline or ◢
CountIsz M, Dsz MAdd or subtract 1 from memory M; if the result is 0, skip the next statement

The six relational operators are =, ≠, ≥, ≤, > and <. A Goto with no matching Lbl raises a Go ERROR.

Conditional jump, from the manual (16 steps). It prints the square root of any non-negative input:

Lbl 1:?→A:A≥0⇒√A◢Goto 1

Count jump, also from the manual (32 steps). It averages ten inputs, using Dsz as a loop counter:

10→A:0→C:Lbl 1:?→B:B+C→C:Dsz A:Goto 1:C÷10

Subroutines

Prog n calls the program in area Pn as a subroutine and returns when it ends. According to the manual, nesting can go to 10 levels; going deeper raises a Ne ERROR, and calling an empty area raises a Go ERROR. A Goto inside a subroutine refers only to labels in that subroutine’s own area. The manual’s worked example uses Ans, the last result, to pass a value back from a subroutine:

P9:  Fix 3:?→A:√3×A²
P0:  Prog 9:Ans×2◢Prog 8

(Excerpt; P8 holds the octahedron-volume fragment.)

Error messages

The fx-7000G manual lists seven error messages. They include Syn ERROR (syntax), Ma ERROR (a result over 10¹⁰⁰, division by zero or an argument out of range), Go ERROR (missing label or empty program area) and Ne ERROR (nesting too deep). The display shows the program area and step number where the error happened.

Example: 99 Bottles of Beer

The program that gave the language its name, as submitted in 2011 (the author notes that the language allows no comments, so the explanatory lines must be removed before entry). It is reproduced with the ◢ symbol, which the archived page shows as ¬, and with Goto in place of the entry’s Gto, the command spelling used in the fx-7000G manual:

99→X
Lbl 1
X
" bottles of beer on the wall, "
X
" bottles of beer."
"Take one down and pass it around, "
X-1
" bottles of beer on the wall."◢
Dsz X
Goto 1
"No more bottles of beer on the wall, no more bottles of beer."
"Go to the store and buy some more, 99 bottles of beer on the wall."

Dsz X counts the bottles down and skips the Goto 1 once X reaches zero. This is the count-jump idiom the manual uses to simulate a FOR loop.

Evolution

Within the first generation, the language grew mainly through the calculators’ features, not new control structures:

  • Original series (1985): fx-7000G, fx-6000G, fx-7500G, fx-8000G and relatives, according to Wikipedia.
  • Power Graphic series (1990): shortcut keys, matrix mode, integration and fractions. The GB models add a serial communications port, so programs could be transferred to a computer.
  • Icon Menu Power Graphic series (around 1993): icon menus, with matrices and equation solving usable inside programs. The fx-7700GE, the model whose manual the 99 Bottles entry cites, belongs here. Wikipedia dates it to 1994; the ledudu Casio collection files it under the 1993 Icon Menu series. Its exact launch year is therefore uncertain.

The second generation, starting with the CFX-9850G and fx-9750G in 1996, added structured commands and screen control such as Locate, Text and Getkey. The lower-end fx-7400G series of the same year lacked Getkey and Locate. That later, richer language is what is usually called Casio BASIC. It kept the older core: → assignment, ⇒ conditionals, ◢ display, and Lbl/Goto/Isz/Dsz all appear in modern Casio BASIC examples.

Platform

The language runs only on the calculators themselves. The fx-7000G has a 96×64-pixel dot-matrix LCD showing 8 lines of 16 characters and runs on three CR2032 lithium cells, according to Wikipedia. This page does not claim any emulator, operating system or other platform support.

Current relevance

The first-generation machines are long discontinued, and the language has no maintained implementation beyond the original hardware. It survives in collectors’ archives of scanned manuals, in retro-calculator blogs, and in the 99 Bottles of Beer collection. Its idioms still show in present-day Casio BASIC.

Why it matters

The fx-7000G put a programmable, graphing machine in students’ hands in 1985, and this language was how they automated it. It shows a pocket-calculator design that fits a working language into a few hundred steps: every statement is a formula, all state is global, and loops are built from labels and a count-down memory. Idioms such as ?→A, Dsz loops and ⇒ Goto are documented here in the form that later Casio BASIC kept, although DSZ-style counting and label jumps already existed in keystroke form on the FX-602P.

Sources and unverified points

  • fx-7000G owner’s manual, chapter 4 (programming), scanned at silrun.de and retrieved from a 16 December 2003 Wayback Machine capture. This is the primary source for the command set, step counts, program areas, nesting limit, error messages and all code examples except 99 Bottles.
  • Casio, “History of CASIO’s Electronic Calculator Business”: 1985 launch of the fx-7000G.
  • 99 Bottles of Beer, “Language Casio 1st-gen BASIC” (entry 2788, dated 11/18/11), retrieved via a 28 July 2014 Wayback Machine capture: the name, the “1st generation” claim and the 99 Bottles program.
  • Wikipedia: Casio fx-7000G, Casio graphic calculators, Casio FX-602P series, Casio FX-702P and Casio BASIC, for series dates and the FX-602P comparison.
  • ledudu.com Casio library: fx-4000P marketed in France in July 1985, and fx-7700GE filed under the 1993 Icon Menu series.
  • Eddie’s Math and Calculator Blog, “Retro Review: Casio fx-4000P” (February 2022).
  • Not verified: the exact launch month of the fx-7000G; the fx-7700GE’s launch year (1993 vs 1994); whether every first-generation model accepts the 99 Bottles program unchanged, as its author claims; and the full command lists of the Power Graphic and Icon Menu models, whose manuals were not consulted.

Timeline

1981
Casio launches the FX-602P keystroke-programmable calculator (with LBL, GOTO and DSZ) and the FX-702P BASIC pocket computer. Neither runs this language, but 1981 is the year the encyclopedia's master list gives for it
1985
Casio launches the fx-7000G, which Casio calls the world's first graphing scientific calculator. Its program mode (422 steps in ten areas, P0-P9) is the earliest documented form of this language
1985
The fx-4000P programmable scientific calculator, with the same Lbl/Goto, Isz/Dsz and ◢ command set and 550 steps, is on sale in France by July 1985
1990
The Power Graphic series (including the fx-7700G) adds shortcut keys, matrix mode and polar and parametric graphing. The GB models add a communications port
1993
Around this year the Icon Menu Power Graphic series introduces an icon-based menu and allows matrices inside programs. The fx-7700GE belongs to this family (Wikipedia dates it to 1994)
1996
The CFX-9850G and fx-9750G begin Casio's second graphing generation, which adds commands such as Locate and Getkey. Wikipedia gives 1996 as the end of the first-generation line
2011
On 18 November 2011 MSS Software & Services submits a 99 Bottles of Beer program titled "Casio 1st-gen BASIC", said to work on all first-generation Casio calculators and citing the fx-7700GE manual. This entry is the source of the language's name

Notable Uses & Legacy

Repeated formula evaluation

The fx-7000G manual shows the program mode being used to repeat one formula for many inputs: the surface area and volume of a regular octahedron or tetrahedron for each side length typed in, and the altitude of a thrown ball at one-second intervals

Shared subroutine libraries in P0-P9

The manual's own worked example moves common formula fragments into separate program areas and calls them with Prog, cutting two programs that took 45 steps between them down to 38 steps

99 Bottles of Beer

A 99 Bottles of Beer program using Lbl, Dsz and Goto, submitted on 18 November 2011 under the name "Casio 1st-gen BASIC", is preserved on the 99 Bottles of Beer site

Retro-calculator reviews

Eddie's Math and Calculator Blog reviewed the fx-4000P in February 2022, documenting its 550-step memory, 10 labels and Isz/Dsz loop idiom for modern hobbyists

Language Influence

Influenced

Casio BASIC

Running Today

Run examples using the official Docker image:

docker pull
Last updated: