The Kaliber Project is a project I started awhile ago to create a virtual machine programming language, and currently I have a working virtual machine and an assembler. I've decided to attempt to bring the virtual machine to the TI-84+CE.
Here's an example of a piece of assembly code for the Kaliber virtual machine:
Code:
It's a bit long but basically it asks you for your name, lets you type it in, then says "Hello, x!" where x is your name.
Here's the compiled program running on my PC:
Here's the same exact program running on the TI-84+CE
Here's a more complex program running on my Windows PC, my Raspberry Pi, and the Nintendo 3DS:
The idea behind this is basically the same as Java, you compile your program to the virtual machine and it runs everywhere. The Windows/Linux/Mac version of the virtual machine (including the assembler and eventual compiler) is being written in C, using GTK+3 for the graphics. The TI-84+CE I actually am building in eZ80 Assembly. The 3DS version is slow because I made it in SmileBASIC, which is an officially supported scripting language, but it works.
So far, the TI-84+CE virtual machine supports all the instructions of the virtual processor, but I still am working on the "system calls", which are system specific operations, although so far I've made them standard across all platforms. These include basic input and output of text, date/time, random number generation, graphics etc.
The virtual machine is 8-bit with registers A-H, but registers A-D and E-H can be combined for 32-bit numbers which you can do 32-bit operations on, and E-H is used for 32-bit memory addressing allowing for up to files 4.3 gigabytes large, although on the TI-84+CE the it is limited 65.5 kilobytes. You are basically limited to whatever you can fit in the 8xv.
Here's all the operations:
The idea behind the this is you can compile a single program and it'll run on Windows, Mac, Linux, Android, iOS, you can embed it in web pages, and, well, it'll run on the TI-84+CE as well for some reason.
Is this going to be some amazing Java-destroying language? No, I'm one person who is mostly self-taught in programming. But maybe some people will find a use for it once it's finished. The language is so abstracted from the hardware it doesn't really take advantage of the hardware, so it's slow. Although fast enough for a lot of things.
Edit: Github
Here's an example of a piece of assembly code for the Kaliber virtual machine:
Code:
main:
;Output "What is your name?: "
GET msg1
MVU $1
MOV $4
EXP B
DST A
SYSCALL
;Input name
GET name
MVU $0
MOV $A
EXP B
MOV $1
SYSCALL
;Output "Hello, "
GET msg2
MVU $0
MOV $7
EXP B
MOV $0
SYSCALL
;Print the inputted name
GET printName
CAL
;Output "!\n"
GET msg3
MVU $0
MOV $2
EXP B
MOV $0
SYSCALL
HLT
;Prints the inputted name
printName:
;Get the address of the name and store it on the stack
GET name
IMP32
PUSH32
printNameLoop:
;Pop the address from the stack
POP32
;Load a character at the address
EXP32
LOD
;Compare it to 0
DST B
CMP B
;If it equals 0, exit
IMP32
PUSH32
GET printNameExit
JPE
;Pop the address from the stack
POP32
EXP32
;Print a single character at that address
MVU $0
MOV $1
EXP B
DST A
SYSCALL
;Increment it by 1
IMP32
INC32
EXP32
;Store the address on the stack and repeat
PUSH32
GET printNameLoop
JMP
;End the loop
printNameExit:
POP32
RET
name:
$r11
msg1:
$"What is your name?: "
msg2:
$"Hello, "
msg3:
$"!"
$0A
It's a bit long but basically it asks you for your name, lets you type it in, then says "Hello, x!" where x is your name.
Here's the compiled program running on my PC:
Here's the same exact program running on the TI-84+CE
Here's a more complex program running on my Windows PC, my Raspberry Pi, and the Nintendo 3DS:
The idea behind this is basically the same as Java, you compile your program to the virtual machine and it runs everywhere. The Windows/Linux/Mac version of the virtual machine (including the assembler and eventual compiler) is being written in C, using GTK+3 for the graphics. The TI-84+CE I actually am building in eZ80 Assembly. The 3DS version is slow because I made it in SmileBASIC, which is an officially supported scripting language, but it works.
So far, the TI-84+CE virtual machine supports all the instructions of the virtual processor, but I still am working on the "system calls", which are system specific operations, although so far I've made them standard across all platforms. These include basic input and output of text, date/time, random number generation, graphics etc.
The virtual machine is 8-bit with registers A-H, but registers A-D and E-H can be combined for 32-bit numbers which you can do 32-bit operations on, and E-H is used for 32-bit memory addressing allowing for up to files 4.3 gigabytes large, although on the TI-84+CE the it is limited 65.5 kilobytes. You are basically limited to whatever you can fit in the 8xv.
Here's all the operations:
The idea behind the this is you can compile a single program and it'll run on Windows, Mac, Linux, Android, iOS, you can embed it in web pages, and, well, it'll run on the TI-84+CE as well for some reason.
Is this going to be some amazing Java-destroying language? No, I'm one person who is mostly self-taught in programming. But maybe some people will find a use for it once it's finished. The language is so abstracted from the hardware it doesn't really take advantage of the hardware, so it's slow. Although fast enough for a lot of things.
Edit: Github