- Working on a JavaScript library for TI-83/84 programs.
- 07 Nov 2013 05:12:02 pm
- Last edited by amihart on 07 Nov 2013 06:28:17 pm; edited 3 times in total
I'm making a library for JavaScript for handling TI-83/84 programs.
This will deal with both TI-BASIC programs and Asm programs.
It currently doesn't support the TI-84+ Color, but I may add support in the future since I expect to get one for Christmas.
This will be able to be used to easily create, read, and edit these types of files.
I've started with Asm programs, and you can do this so far:
Code:
Note that this isn't a full assembler.
It just takes your hex and assembles it into a working program.
Like "AsmComp(".
That will generate a file named "hello.8xp" (in which will be named HELLO on the calculator) and can be ran with "Asm(prgmHELLO" and will display "Hello, World!" and skip a line. It then downloads the file to your computer.
".hex" is obviously the hex to your program.
It's just the hex in the data section after "BB6D".
So essentially, this will assemble your hex just like the assembler that comes with the TI-83/84 calculators.
".genBinary()" generates a binary array in which is stored in ".binary".
If you run ".download()", it converts the array to your binary file and downloads it to your computer.
There also ".setComment()" in which you can use before ".genBinary()" to add your own comment at the top. It's not required, tho. And the default comment is just a bunch of spaces.
This part is working pretty well.
What I am currently working on now is making TI-BASIC files work.
When they're done, you should be able to create one like so:
Code:
This will do the same thing as the previous code. This time, it will generate a TI-BASIC program.
This will be able to be used to easily make web services in which generate TI-83/84 programs, or even make a web-based assembler. And since it's JavaScript, you do not even have to assemble it server-side. It can be completely assembled client-side. It can also be paired with Chrome desktop apps, in case you do not want to make a web app.
This will deal with both TI-BASIC programs and Asm programs.
It currently doesn't support the TI-84+ Color, but I may add support in the future since I expect to get one for Christmas.
This will be able to be used to easily create, read, and edit these types of files.
I've started with Asm programs, and you can do this so far:
Code:
<body>
<script src="ti83plus.js"></script>
<script>
var prgm = new TI83PRGM("hello","asm");
prgm.hex = "BB6D219F9DEF0A45EF2E45C948656C6C6F2C20576F726C642100";
prgm.genBinary();
prgm.download();
</script>
</body>
Note that this isn't a full assembler.
It just takes your hex and assembles it into a working program.
Like "AsmComp(".
That will generate a file named "hello.8xp" (in which will be named HELLO on the calculator) and can be ran with "Asm(prgmHELLO" and will display "Hello, World!" and skip a line. It then downloads the file to your computer.
".hex" is obviously the hex to your program.
It's just the hex in the data section after "BB6D".
So essentially, this will assemble your hex just like the assembler that comes with the TI-83/84 calculators.
".genBinary()" generates a binary array in which is stored in ".binary".
If you run ".download()", it converts the array to your binary file and downloads it to your computer.
There also ".setComment()" in which you can use before ".genBinary()" to add your own comment at the top. It's not required, tho. And the default comment is just a bunch of spaces.
This part is working pretty well.
What I am currently working on now is making TI-BASIC files work.
When they're done, you should be able to create one like so:
Code:
<body>
<script src="ti83plus.js"></script>
<script>
var prgm = new TI83PRGM("hello","tibasic");
prgm.txt = "Disp \"Hello, World!\"";
prgm.genBinary();
prgm.download();
</script>
</body>
This will do the same thing as the previous code. This time, it will generate a TI-BASIC program.
This will be able to be used to easily make web services in which generate TI-83/84 programs, or even make a web-based assembler. And since it's JavaScript, you do not even have to assemble it server-side. It can be completely assembled client-side. It can also be paired with Chrome desktop apps, in case you do not want to make a web app.