Most of this was copied from BOSshell's thread
I have dreamed of making an interpreted language for the CE, and now, that dream is closer to reality than ever before!
Introducing: BOS-BASIC!
This language is run directly from a TI-BASIC program, no need to open any kind of interpreter first!
Code:
This one line of code will make the rest of your program run as BOS-BASIC!
BOS-BASIC will have a whopping 62 one-character variables!
It will have all the functionality of ICE!
An example "Hello World" program:
Code:
Another capability of this language is it's ability to recognize a token both input from a menu, or written character-by-character, as the same command!
Current command list (including TO-DOs) and what they do:
Code:
Variable syntax:
Code:
Value syntax:
Code:
I've added a bunch of variable aliases, so you don't have to remember which variables are which
Also the key code register, the current draw colors, and the current draw position, are not a part of the 62 user vars, so more possibility!
The character used to indicate an alias is the exclamation mark ("!")
The aliases that are currently implemented:
Code:
NOTE: The arrow key variable stores the state of all the arrow keys. So the 4 bits are down,left,right,up in ascending order. I will be adding operators to make this easier to use in the future
Another feature I plan to add is the ability for one variable to store both a string and a Y offset!
<explanation>
This is possible due to a string variable in BOS-BASIC actually being written to a temporary file when created, and that any variable on the calculator can only have up to 64K [-ish] adresses. Variables in BOS-BASIC, being 3 bytes each, can store that file offset, and an extra byte!
</explanation>
Or I could also perhaps make that byte able to be a color. Which one it is used as would depend on what print routine you use.
There is still no scheduled release for BOS-BASIC at this time.
BOS-BASIC is also currently faster than TI-BASIC too!
Suck it, TI
I will be adding a lot more to this language, so stay tuned for more!
I have dreamed of making an interpreted language for the CE, and now, that dream is closer to reality than ever before!
Introducing: BOS-BASIC!
This language is run directly from a TI-BASIC program, no need to open any kind of interpreter first!
Code:
Asm(prgmBOSBASIC
This one line of code will make the rest of your program run as BOS-BASIC!
BOS-BASIC will have a whopping 62 one-character variables!
It will have all the functionality of ICE!
An example "Hello World" program:
Code:
Asm(prgmBOSBASIC
GFX
Disp Hello World!
LET 11=x05
Disp Hello World in Green!
FLIP
getKeyWait
GFX
Another capability of this language is it's ability to recognize a token both input from a menu, or written character-by-character, as the same command!
Current command list (including TO-DOs) and what they do:
Code:
GFX - toggle full-screen graphics
Disp String - put the following text to the screen. Will scroll the text if it overflows the bottom of the screen, just like on the homescreen
LET var=value - store value to var
getKey - get key value and update key register
getKeyWait - wait until a key is pressed, update key register
FLIP - display graphics. Use this when you are done drawing, right before getting a key value. Uses "Blit(1" (ICE)
Lbl NAME - program label
Lbl NAME var - program label. Stores label offset from start of program to var
Goto NAME - goto label
vGoto var - goto label from offset stored in var
Call NAME - call label
vCall NAME - call label from offset stored in var
Return - Return from subroutine (Call )
++ var - add one to variable
-- var - subtract one from variable
+val var - add value to variable
-val var - subtract value from variable
*val var - multiply var by val
/val var - divide var by val
^2 var - square var
θ+ var1 var2 - add var1 to var2 and store to var1 (works with "+","-","*", and "/")
θ+ var1 var2 var3 - add var1 to var2 and store to var3 (works with "+","-","*", and "/")
// - comment
If/Else/End works same as in ICE, but only one variable can be compared with a variable or value for each "If" statement.
Variable syntax:
Code:
There are 62 variables. 0-9, A-Z, and a-z.
A variable is accessed by adding one of the following to the end:
:a - get/store all 3 bytes
:x - get/store the first two bytes of a variable. Usually for an X coordinate, like when you are going to draw something
:y - get/store the last byte of a variable. Usually the Y coordinate
:0, 1, and 2 - the first, second, and third bytes of the variable
:d - get/store from the adress stored in the 3b of the variable
:o - get/store from the offset (from the temporary data file) stored in the first 2b of the variable
ex: Aa - 3b number from variable A
ex: 0x - current X draw coordinate
ex: 0y - current Y draw coordinate
ex: 10 - current Background color
ex: 11 - current Foreground color B
ex: 12 - current Foreground color A
NOTE: when setting all 3 colors at once, use a hexidecimal value "x000000" where the first two are Foreground colors B and A, and the last one is Background color.
Value syntax:
Code:
:0 - regular integer value
:x - hexadecimal value
:" - string value (will actually append the string to the temp file. Gets the offset of the first byte of the string)
:: - hexidecimal string (appends to temp file and gets the offset)
ex: 0256
ex: x100
ex: "Hello World!
ex: :0102030400
I've added a bunch of variable aliases, so you don't have to remember which variables are which
Also the key code register, the current draw colors, and the current draw position, are not a part of the 62 user vars, so more possibility!
The character used to indicate an alias is the exclamation mark ("!")
The aliases that are currently implemented:
Code:
!key - stores the keycode returned by getKey or getKeyWait
!arrow - stores the arrow keys returned by getKey or getKeyWait
!BGC - current background draw color
!TAC - current foreground A color
!TBC - current foreground B color
!TextX - current text X draw position
!TextY - current text Y draw position
NOTE: The arrow key variable stores the state of all the arrow keys. So the 4 bits are down,left,right,up in ascending order. I will be adding operators to make this easier to use in the future
Another feature I plan to add is the ability for one variable to store both a string and a Y offset!
<explanation>
This is possible due to a string variable in BOS-BASIC actually being written to a temporary file when created, and that any variable on the calculator can only have up to 64K [-ish] adresses. Variables in BOS-BASIC, being 3 bytes each, can store that file offset, and an extra byte!
</explanation>
Or I could also perhaps make that byte able to be a color. Which one it is used as would depend on what print routine you use.
There is still no scheduled release for BOS-BASIC at this time.
BOS-BASIC is also currently faster than TI-BASIC too!
Suck it, TI
I will be adding a lot more to this language, so stay tuned for more!