Here are some things that I always forget about programming/working with my Tandy PC-6 (Casio fx-790p) Much of these will work on the PC-4 as well, and probably the PC-5, which is very similar to the PC-6.
I've made a screen font that looks just like the PC-4/5/6, and is available at Fontstruct.com
When editing, shift-l to list, and then EXE will move on line by line. Shift-EXE will go back to the previous line.
Most of the Tandy PC-4/PC-5/PC-6 follow standard BASIC keywords although there are of course some that are specific to these devices.
- moves the cursor to this position on the screen
- n is a digit from 0 to 23
- example: 10 PRINT CSR0;A;CSR10;B;
- this prints A at position 0, B at position 10
- NOTE: on PC-4 but 0 to 11
BEEP, BEEP0, BEEP1
- BEEP and BEEP0 play a low pitched tone
- BEEP1 plays a high pitched tone
- NOTE: not available on PC-4
A vrs A$
- A is storage of an integer
- A$ is storage of a string
GOSUB #n, GOTO #n
- n is 0 to 9
- This continues execution on the specified bank
- handy for grouping commonly used code together
- read from the memo bank into A$
- fails when it's run out of memo entries
- NOTE: not available on PC-4
- reads in the key being pressed
- blocks on no input
- useful for games. example:
10 REM SHOW KEY BEING PRESSED 20 A$ = KEY$ 30 PRINT CSR1;A$; 40 GOTO 10
- Or for fun (run with BUZZER turned on, [MODE][.]
10 REM DIGITAL CRICKET 20 A$ = KEY$ 30 GOTO 10
PC-5 and PC-6 added a MEMO function. This is not available on PC-4.
To enter a memo, you need to be in RUN mode (mode 0). then just type stuff and hit mode-9 to write it into the memo bank.
Press MEMO to roll through all entries.
Type the first letter(s) of an entry and hit MEMO. It will go to the entry if it finds one that starts with that text. If it can't find it, it will display an empty line. (Probably not on PC-5)
PC-5 and PC-6 added Function Memory and execution. This is not available on PC-4.
To start with, let's put a simple function in there. Go to run mode, mode-0. Next, let's enter a simple function. Type:
- A+B [IN]
And run it by pressing [CALC]. it will prompt you for A and B, and then print out the answer. You can also store this into a MEMO:
A ? [EXE] 2 B ? [EXE] 5 7
Now you can recall this function at any time by hitting [MEMO] until you find the function, then [IN] to load it into function memory. Next, you can press [CALC] to run this function.
Next, we can label the variables, so that the user (you) is prompted with actual names for the variables, rather than the variable letter. This is done by putting the name to be displayed in quotes immediately after the variable. These variables will be prompted to the user in the order they're pre-listed, rather than the order they're in the function.
- A"ONE":B"TWO":A+B [IN]
Now, when you run it, you get different results:
ONE ? [EXE] 2 TWO ? [EXE] 5 7
Note that it will display the values as you enter them. This is handy if you put in complex functions there. when you entered '2' above, you could enter "10*3" and it will display "30" back at you.
You can also change the order like so:
- B"TWO":A"ONE":A+B [IN]
You can also just define the names inline, which isn't as readable when the function is complex.
- A"ONE"+B"TWO" [IN]
It should also be noted that these values are the same as the BASIC memory space, so you can store the results in another variable, like so:
- A"INA":C=A*5 [IN]
INA ? [EXE] 2 C= 10
And you can also do something like this, in this case, where you use the previous value of 'A' without changing its value. Note that you can also name result values. - A"IN":A"RESULT"=A*5 [IN]
IN ? [EXE] 6 RESULT= 30 IN ? [EXE] 30 RESULT= 150