ZX81 Calculator

Developer(s): Alex Burr (K5XY)
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000

Two short programs that put the ZX81 into a calculator mode. RUN (or GOTO 100), then type any expression the computer accepts, however complicated, and press ENTER; the answer appears at the bottom of the screen and the screen scrolls up, so a long session never ends with report 5. The last answer is kept in L, so L/2 halves it.

Version 1 (4 lines) shows only the answers. Version 2 (7 lines) takes the input as a string and shows what you typed, then the answer indented below it. BREAK does not work while the program waits for input; to stop, enter any number and then press BREAK. Both versions are in the download.

Published in Syntax December 1982 (ZX81 Calculator).

Related Articles

Use the Sinclair's expression evaluator to make a calculator.

Image Gallery

Source Code

Version 1:
100 INPUT L
110 SCROLL
120 PRINT L
130 GOTO 100

Version 2 (shows what you typed):
100 INPUT L$
110 LET L=VAL L$
120 SCROLL
130 PRINT L$
140 SCROLL
150 PRINT "  ";L
160 GOTO 100

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.