LANGUAGES

FORTH-TO7.

The FORTH-79 that SEFI published for the Thomson TO7 in 1983, on a TO2026 cartridge. You type numbers and words, the machine answers on the same line, then OK. You teach it new words, each built on the previous ones, until the last one runs the whole application. With the TO7 screen, its eight colours and its 320 by 200 dots, music, BASIC-style strings, and the blocks and screen editor of the original cartridge.

The complete language reference (in French)

The TO7 screen with the FORTH-TO7 version 1.0 banner: some arithmetic, the definitions of CARRE and CUBE, a switch to hexadecimal, an unknown word and the stack display.
THE CONSOLE. No prompt: the answer and OK follow the typed line.
Nested rectangles in every colour, drawn with BOX, with colours spilling over by groups of eight dots as on the TO7.
CADRES. A program from the system disk: BOX and GCOLOR, two colours per group of 8 dots.
The full-screen editor on block 12: a comment, the definitions of CARRE, CUBE and TABLEAU, and the screen number at the bottom.
THE SCREEN EDITOR. A 1024-character block, full screen, one key per command.
Block 12 loaded with LOAD: a table of the numbers 1 to 10, their squares and their cubes, right-aligned with .R.
12 LOAD. The block is interpreted as if it were typed: the table appears.
FORTH
( CARRES ET CUBES )
: CARRE ( n --- n*n ) DUP * ;
: CUBE ( n --- n*n*n ) DUP CARRE * ;
: TABLEAU 11 1 DO CR I 4 .R I CARRE 6 .R I CUBE 8 .R LOOP ;
TABLEAU

The language

  • The stack and reverse Polish notation: 2 3 + .; DUP, SWAP, OVER, ROT, and .S to look at the stack
  • Definitions : NAME ... ;, constants, variables, SEFI's arrays (ARRAY, TABLE) and CREATE ... DOES>
  • The structures IF ELSE THEN, DO LOOP, BEGIN UNTIL, WHILE REPEAT, and SEFI's additions: CASE OF ENDOF ENDCASE, GODO, /LOOP
  • 16-bit numbers, 32-bit doubles, any base from 2 to 36; BASIC-style strings: STRING, MID$, INSTR, STR$, INPUT$

The machine

  • The TO7 screen: 40 columns by 25 lines, 320 × 200 dots, eight bright and eight pastel colours; PSET, LINE, BOX, BOXF, POINT, LOCATE, WINDOW, DEFGR
  • Music: NOTE, and scores in tables: MUSTAB, do re mi, PLAY
  • Keyboard, joysticks and light pen (the mouse): KEY, INKEY, STICK, INPEN, ONPEN
  • The original two-letter messages: WORD ? UK ERROR, ES, FS, UF…

Programs and disks

  • 1024-character blocks, stored as BLOCKn.DAT files on the disk: n EDIT, n LIST, n LOAD, THRU, FLUSH
  • Saving the dictionary: 0 SAVE into DICT0.FTH, 0 RUN to load it back, AUTORUN to start it by itself
  • As in the other cartridges: the program in memory as a .4TH file, EDIT, RUN, SAVE "NAME", LOAD "NAME", and the AI ON assistant
  • RUN "CADRES", RUN "TABLES" and RUN "FRERE": three programs on the system disk

SEFI's cartridge, rebuilt

FORTH was created by Charles Moore to drive telescopes with very little memory: a tiny interpreter and a dictionary the programmer extends. In 1983, SEFI published a FORTH cartridge for the TO7 through TO-TEK, with its reference manual. The TO2026 one was rebuilt from that manual and from the behaviour of the original cartridge: same dictionary, same messages, same memory map, so that a program copied from the 1983 manual runs as is. No SEFI code is reused.