How To Program The Tutor

So, you want to hack your dear Tomy to bits! You've come to the right place, you freak. This assumes you already know how to program in BASIC (preferably on another classic computer architecture, where the similarities are more prolix).

Updates and corrections are gratefully accepted. Last modify 6 July 2014.

Then, how do you get them to and from your desktop computer? That's what XTOMYDEV is for!

Back to the main page

[Tomy Tutor BASIC]
Tomy BASIC, as shown in Tutti.

Assembly Programming

One day, my son, one day. 'Till then, feast your eyes on this very incomplete set of memory maps and learn 9995 assembly.

The Tomy's BASIC Languages

The Tutor has two BASIC dialects, the very limited GBASIC, available through the GRAPHIC option from the menu, and the "true" BASIC, available from the BASIC option from the menu. If you have a very early Tutor or Pyuuta, you only have GBASIC. Sorry.

GBASIC is so different from BASIC that it has its own section.

Differences Between Microsoft BASIC, TI BASIC, Tomy BASIC and GBASIC

Nota Bene: These sections assume you know a bit about BASIC. If you have an interest in classic computers, you probably know BASIC already, or at least enough to understand the following.

Tomy Tutor BASIC is very similar to TI BASIC, and inherits similar quirks. Multistatement lines are separated by the double colon (::), for example, in both; and the : in a PRINT inserts a line feed. Mercifully, the TI CALL series of commands have been turned back into their more standard equivalents.

GBASIC is totally dissimilar and supports only a subset of features. Its syntax is also considerably more constrained, and its keyword set is definitely unusual.

Here's a comparison of BASICs between a Commodore 64 (call it our "vanilla" Microsoft BASIC machine, as its BASIC 2.0 is unadorned but supports the lowest common denominator of Microsoft BASIC keywords and syntax), a TI, and both Tomy dialects:

Function C64 TI 99/4A Tomy BASIC Tomy GBASIC
clear the screen (1) CALL CLEAR CLS (5)
take a substring MID$(a$,b,c) or MID$(a$,b) SEG$(a$,b,c) SEG$(a$,b,c) (not MID$, as the manual alleges) not available
sound a tone (2) CALL SOUND(a,b,c,d,e,f) SOUND(a,b,c,d,e,f) TONE NOa limited to predefined sounds only
get a keypress GET a$ CALL KEY(a,b,c) KEY(a,b) (6)
get joystick data (2) CALL JOYST(a,b,c) KEY(a,b) KEY a b,c
load a shape into a character cell (2) CALL CHAR(a,b$) MCELL(a,b$) (5)
put a character at a specific screen position TAB(a), SPC(a) (3) CALL HCHAR(a,b,c), CALL VCHAR(a,b,c) SCELL(a,b,c,d) (5)
get a character at a specific screen position (2) CALL GCHAR(a,b,c) GCELL(a,b,c) (7)
changing the screen colour (2) CALL SCREEN(a) SCREEN(a) (5)
changing the colour of an onscreen character (2) CALL COLOR(a,b,c) COLOR(a,b,c) (5)
opening a device or file OPEN a,b,c,d$ OPEN #a:b$ not available (but see the # operator) not available
writing to a device or file PRINT #a,b$ PRINT #a b$ undocumented, only works for device 0, i.e., the screen (see the # operator) not available
closing a device or file CLOSE a CLOSE #a not available (again, see above) not available
randomize RNG RND(-seed) RANDOMIZE RANDOMIZE not needed?
OS and direct memory access POKE a,b, q=PEEK(a), SYS a (4) not available (but see the SCELL and MCELL commands) not available (but see the CELL keyword)
Footnotes: (1) no specific BASIC keyword. Use PRINT CHR$(147). (2) no specific BASIC keyword. Requires POKE, PEEK, SYS or other operating system access. (3) horizontal only. Cursor controls can be embedded in PRINT statements, or through an OS call. (4) Extended BASIC allows some of this. (5) Done either through GRAPHIC mode drawing, or cell-to-cell copying with the CELL keyword. (6) Some keys may be intercepted by reading the joystick. (7) Certain attributes of a cell may be read with CELL and string variables.

Question C64 TI 99/4A Tomy BASIC Tomy GBASIC
can you put statements after THEN? (e.g. IF Q=1 THEN PRINT"HELLO") yes no no no
can you put ELSE with THEN? (e.g. IF Q=1 THEN 400 ELSE 300) no yes yes no
automatic line numbering? no yes (NUM a,b) yes (AUTO a,b) no
automatic line renumbering? no yes yes (RENUM a,b) no
can you do I/O or tape and device access in a program? yes, no restrictions yes, no restrictions printer only (LPRINT), tape from direct mode only (but again, see above) no
can you put multiple statements on a line? (e.g. PRINT A:PRINT B) yes yes (using double colon) yes (using double colon) no
number of letters significant/allowed in variable names 2/15 15/15 15/15 4/4
do you need LET for variable assignment? no no no no

Sample Programs

Here's our library of Sample Programs to try out and get a feel for hot coding, Tutor style.

Supported Tomy Keywords and Tokens

Here's a comprehensive list of keywords allowed in Tomy BASIC, along with internal representations, undocumented keywords, and explanations.

Known GBASIC and MONitor Keywords

Nota Bene: If you don't know how to program in GBASIC, check out this tutorial first! Otherwise, here's a (so far) comprehensive list of keywords and commands in GBASIC and the MONitor.
Back to the main page