Axe Parser v0.1.2


Currently Supported Commands

Command Description
: The colon and enter key count as terminating whitespace. They simply end the previous expression. Spaces are non-terminating whitespace and do absolutely nothing.
. The period is a single line comment. Whatever follows will be ignored until the next newline. Must be the first character on the line.
ClrHome Erases the screen and text shadow and moves the cursor to the upper left corner.
ClrDraw Erases the buffer.
DispGraph Draws the buffer on the screen.
StoreGDB Copies the screen to the buffer.
StorePic Copies the buffer to the back-buffer.
RecallPic Copies the back-buffer to the buffer.
DiagnosticOn Turns on the run indicator (marching ants). Program will display "done" after finishing.
DiagnosticOff Turns off the run indicator. Program will not display "done" after finishing.
Full Full speed mode is activated if supported, making it nearly 3 times faster on 15MHz calculators. Returns 0 if the mode is not supported.
Normal Full speed mode is deactivated if it was previously on.
Asm(HEX) Native assembly code written in hexadecimal will be inserted at the current position in the code.
Lbl LBL Creates a label at the current position in the code.
Goto LBL Jumps to the given label.
DelVar LBL Frees the label from memory. It can then be redefined and reused somewhere later in the code.
Sub(LBL) Calls the given subroutine.
Return Returns from a subroutine. Also, if the statement was not in a subroutine, the program will end.
ReturnIf EXP A conditional Return. In other words, it will only return from the subroutine if the expression is true.
getKey Expression becomes the last key pressed. It is zero if no keys are pressed.
getKey(KEY) Expression becomes 1 if the key is currently being held down and 0 otherwise. The keycode must be a single constant.
rand Expression becomes a random 16-bit number.
"" Creates a non-terminating string in memory.
""NAME Creates a terminating string in memory and names it.
[HEX] Writes the data to the end of the program.
[HEX]→NAME Writes the data to the end of the program and names it.
EHEX The expression becomes the hexadeciaml value. It must be exactly 4 digits. That 'E' is the scientific notation symbol.
'CHAR' The expression becomes the ASCII value of the single character between the apostrophes. It can even be another apostrophe.
VAR The expression becomes the value of the variable.
EXPVAR Stores the previous expression into the variable. The expression remains intact.
NAME The expression becomes the pointer to the data.
{EXP} The byte pointed to by the expression becomes the new expression.
EXP1→{EXP2} The byte of expression1 is stored into the location pointed to by expression2.
-EXP The expression is negated. That's a negative sign, not a minus sign!
EXP1+EXP2
EXP1-EXP2
Expression2 is added to or subtracted from expression1.
EXP1*EXP2
EXP1/EXP2
EXP1^EXP2
Expression1 is multiplied, divided, or the modulus of expression2.
EXP1=EXP2
EXP1EXP2
EXP1<EXP2
EXP1EXP2
EXP1>EXP2
EXP1EXP2
Becomes 1 if the statement is true and 0 if it is false.
EXP1 or EXP2
EXP1 and EXP2
EXP1 xor EXP2
Does the bitwise operation of expression1 with expression2.
abs(EXP) Returns the absolute value of the expression.
int(EXP) Returns a sign extention for the expression. Converts a signed byte in the range -128 to 127 into a 16 bit number in the same range.
Pause EXP Pause for the given amount of time in milliseconds.
If EXP
code1
End
If the expression is true, code1 will be executed.
If EXP
code1
Else
code2
End
If the expression is true, then only code1 is executed. Otherwise, only code 2 is executed.
!If EXP
code1
End
If the expression is false, code1 will be executed.
!If EXP
code1
Else
code2
End
If the expression is false, then only code1 is executed. Otherwise, only code 2 is executed.
While EXP
code1
End
The expression is first checked. If it is true, Code1 will be evaluated over and over until it is false.
Repeat EXP
code1
End
The expression is first checked. If it is false, Code1 will be evaluated over and over until it is true.
For(VAR,EXP1,EXP2)
code1
End
The variable is initialized with expression1. Until the variable is greater than expression2, code1 is executed and the variable is incremented.
Disp EXP The string pointed to by the expression is displayed at the current cursor position. The cursor is moves with the string. If it reaches the end of the screen, it will loop around to the next line.
Disp EXP▶Dec The value of the expression is displayed at the current cursor position in base 10. The cursor is then advanced 5 spaces.
Disp EXP▶Frac The ASCII character the expression represents is displayed at the current cursor position. The cursor is advanced. A new line is added if it hits the edge.
Disp "" The terminating string is displayed at the current cursor position, but is not saved in the memory.
Disp i New line character. The cursor is advanced to the next vertical line. This is the imaginary, not lowercase 'i'.
Output(X) The cursor is moved to the coordinate position (X/256,X%256).
Output(X,Y) The cursor is moved to the coordinate position (X,Y).
Output(X,Y, The cursor is moved to the coordinate position (X,Y) and whatever follows is displayed at that position.
Pxl-On(X,Y) A pixel becomes black at the given position on the buffer.
Pxl-Off(X,Y) A pixel becomes white at the given position on the buffer.
Pxl-Change(X,Y) A pixel will change color at the given position on the buffer.
pxl-Test(X,Y) Expression becomes 1 if pixel is black and 0 if pixel is white on the buffer.
Pt-On(X,Y,PIC) The 8x8 sprite pointed to by the third expression is drawn to the buffer, without erasing behind it, at the given coordinates.
Pt-Off(X,Y,PIC) The 8x8 sprite pointed to by the third expression is drawn to the buffer, after erasing behind it, at the given coordinates.
Pt-Change(X,Y,PIC) The 8x8 sprite pointed to by the third expression inverts its pixels on the buffer at the given coordinates.
DrawInv The colors on the buffer are inverted.
Horizontal +
Horizontal -
The buffer is shifted right (+) or left (-) by 1 pixel. White pixels are shifted in.
Vertical +
Vertical -
The buffer is shifted down (+) or up (-) by 1 pixel. New pixels are not shifted in, that row remains the same.
L1
L2
L3
L4
L5
L6
Expression become a pointer to some free RAM.
L1 = 714 bytes (saveSScreen+54) Volatility: LOW
L2 = 531 bytes (statVars) Volatility: LOW
L3 = 768 bytes (appBackUpScreen) Volatility: MED (Saving to back-buffer will corrupt)
L4 = 232 bytes (tempSwapArea) Volatility: MED (Corrupt when archiving/unarchiving in program)
L5 = 128 bytes (textShadow) Volatility: MED ("Disp","Output", and "ClrHome" will corrupt)
L6 = 768 bytes (plotSScreen) Volatility: HIGH (Any buffer drawing will corrupt)
Fill(PTR1,SIZE) Whatever byte is already at the location Ptr1 is copied to Size more consecutive bytes. Zero is not a valid Size.
conj(PTR1,PTR2,SIZE) Size bytes starting from the location Ptr1 are copied to the location at Ptr2. Zero is not a valid Size.
expr(PTR1,PTR2,SIZE) Size bytes starting from the location Ptr1 are exchanged with the bytes starting at the location Ptr2. Zero is not a valid Size.


Documentation for Axe Parser
Copyright (c) 2010 Kevin Horowitz