Hello, I am currently wondering as to what makes the TI-Basic interpreter tick as currently I want to widen the audience of TI-Basic by making a (sort-of) emulator that only runs basic as to not get muddled up with copyright issues as no roms would be distributed nor needed. Think of this project as similar to the CHIP-8 systems of old but I havent been able to figure out what is making a seemingly random string of bytes work as both a hex editor and notepad++ have brought up no concrete results as to how such an interpreter would need to work as I do want it to be able to run directly from files in the 8xp format. If anyone has any information regarding 8xp files as BASIC source code please share.
HacksAndSlash wrote:
Hello, I am currently wondering as to what makes the TI-Basic interpreter tick as currently I want to widen the audience of TI-Basic by making a (sort-of) emulator that only runs basic as to not get muddled up with copyright issues as no roms would be distributed nor needed. Think of this project as similar to the CHIP-8 systems of old but I havent been able to figure out what is making a seemingly random string of bytes work as both a hex editor and notepad++ have brought up no concrete results as to how such an interpreter would need to work as I do want it to be able to run directly from files in the 8xp format. If anyone has any information regarding 8xp files as BASIC source code please share.


Is this emulator intended to run on a computer or the calculator? Because the intended platform will make a huge difference in how efficient you program has to be. If your aiming at PC, then your program doesn't have to be extremely efficient; but if you want this to be a calc emulator, it will definitely have to be pretty efficient. Other than that, I believe that the TI-basic interpreter treats each program as a string. In other words, everything is stored in the order that it is typed. I could be totally wrong, but a string-like approach to interpreting makes sense as to why TI-Basic is so slow.
TI-BASIC is a massive pain to interpret. Writing your own interpreter for it would basically be equivalent to rewriting the entire operating system that the calculators run on, since a large percentage of the calculator's functionality can be used from TI-BASIC.

With that being said, the actual storage format of .8xp files isn't that complicated - it's made up of a bunch of one- or two-byte tokens. A token might be a single letter long, like A, or be a multi-character command, like For(. Basically no pun intended, anything that you can skip the cursor over with one press of the arrow keys in the program editor is a token. You can find a list of tokens and their hex values on TiBasicDev, or use the tivars_lib_cpp library or CLI.

(also, wooo, 300000 posts!)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement