This is a simulation of a Forth-based graphing calculator running on a 6507 microprocessor, which is a derivative of the 6502. The calculator has an 8 level stack. Unlike most Forths, stack items can be one of four types: 64-bit decimal floating point, 16-bit hexadecimal number, 16-bit garbage collected pointer, and strings up to 8 characters in length. The floating point numbers use decimal arithmetic and have 12 digits of precision with an exponent range of ±999.
See System information above to pause the simulation and step through the program.
GitHub: 6507 Graphing Calculator
Input
Numbers, operations, and words (in Forth, “words” are equivalent to functions or subroutines) can be entered on the input line. Multiple items can be entered on the same line.


The exponent symbol is lowercase e which is accessed with shift+e. Uppercase E will not work!


Input has the following limitations:
Data Types
There are four data types. Check the Word List to see which data types each word accepts.
| float |
decimal floating point number with 12 decimal digits of precision and ±999 exponent range. Press shift+e for exponent symbol.
Maximum value: 9.99999999999e999
Examples: 5, 3.14159, 123e20
|
| raw hex |
16-bit hexadecimal number. Prefixed with $. |
| smart hex |
16-bit garbage collected pointer. Prefixed with $. The pointer is automatically updated during garbage collection. Produced by the word ' and cannot be entered manually by the user. |
| string |
string of up to 8 characters. |
Variables
Variables can be created with the word VAR and stored to with the word STO. If a variable does not exist, STO will create it. To recall the value stored in a variable, use the variable's name. Pressing Shift+S produces the symbol 🡪 which is a shortcut for STO.




Important: Do NOT use ! or C! to store data in a variable! These words are for low-level system access only.
Words
See the Word List for a description of each word the calculator supports. Below is a list of all words organized by category:
Programming
The programming model is very similar to other Forths. New words are defined with the : word and end with ; (in Forth, “words” are equivalent to functions or subroutines). The following example defines a word FOO that pushes 5 to the stack:
: FOO 5 ;
The calculator has 2 KB of RAM with about 1.6 KB free for programs and variables.
See the Words section above for all supported words.
Hardware
Processor: MOS 6507