This is just a quick reference for what Parsnip supports. Some of this is likely to change; this project is a work-in-progress. As well, I will likely not keep this up-to-date as I am more focused on the parser. These commands are more to test the parser and show off in screenshots what is possible.
Parsnip features a bunch of variable types, with plans for some more core types.
ui8
,ui16
,ui32
are the unsigned integers, where Parsnip generally defaults toui16
. At this moment, signed integer types aren't supported, but they are planned. (It's a bit tedious, and right now I'm focusing on the parser itself).true
andfalse
are boolean types. When converted to a string, they displaytrue
andfalse
, respectively, but evaluate to1
and0
for math. Ex.,3+(1=1)
returns4
as you might expect in TI-BASIC.xfloat
andsingle
are float types, where Parsnip defaults toxfloat
, a higher-precision 80-bit float. Most of the math commands supportsingle
types, but I don't think I have anything that outputs asingle
type to be used, yet.fixed1616
andfixed88
are somewhat supported. These are fixed-point formats, and just as a proof-of-concept, integer division returns afixed1616
if it doesn't divide evenly.string
is a string type.raw
is for raw data. Currently, this is what the sprite routine requires.
I have programmed in:
→
, store the value to a var. Currently allows single-character names, A through Z and theta.+
-
*
/
, currently returns a fixed 16.16 if not an integer.^
, returns a float√(
, returns a floate^(
, returns a floatln()
, returns a float2
(squared)3
(cubed)-1
, returns a floatint(val)
converts to a 32-bit unsigned integer, or 16-bit unsigned if small enough.(-)
, negation.=
≠
>
≥
<
≤
"string"
is a string and must have a closing quote.
These work as in TI-BASIC, but you can be more creative with the names. In the future, the allowed chars will probably be restricted to alphanumeric.
Works like in TI-BASIC.
Currently very limited. It can only conditionally execute one line of code.
Then
and Else
are not yet supported, and End
isn't used by this.
These work basically like in TI-BASIC, but of course ClrDraw doesn't also update the LCD (like how Axe and Grammer do it).
Copies the contents of the graph screen to the LCD.
Displays a value on the homescreen.
Text(Y,X,value)
Displays a value on the graph screen at pixel coordinates, using a small font.
NOTE: This might change in the future, specifically the default font and coordinate system for text.
Waits for [Enter]
to be pressed.
getKey()
returns the current key press.
getKey(val)
returns true
if the key is being pressed, else false
.
raw("hexadecimal string")
converts a string of hexadecimal digits to raw
bytes. Currently useful for sprite data
Sprite(raw,y,x,method)
draws an 8x8 sprite using the first 8 bytes of raw
at
(y
,x
) pixel coordinates, using method
:
- 0 - Overwrite
- 1 - AND logic
- 2 - XOR logic
- 3 - OR logic
- 5 - Erase logic
NOTE: In the future, this will change; in particular, a raw
type
variable will not be used.
Works like in TI-BASIC, except pxl-Test()
returns true
/false
instead of
1
/0
. (However, for math purposes, true
and false
evaluate to 1 and 0.)
Sets 15MHz mode. TI-BASIC automatically sets 15MHz mode.
Works similar to TI-BASIC, but not the same. This sets the max number of digits when displaying a float.