|codinget 86a52ed62f||2 years ago|
|CASIO_fxlib||2 years ago|
|assembler||2 years ago|
|common||2 years ago|
|data||2 years ago|
|doc||2 years ago|
|interpreter||2 years ago|
|.gitignore||2 years ago|
|BUILDING.md||2 years ago|
|README.md||2 years ago|
|TODO.txt||2 years ago|
This is a language, assembler and interpreter designed to run on the CASIO calculators and computer alike.
This language is meant to be assembled, not compiled, and can be assembled on the computer or the calculator.
Yes! Even though not everything works, it compiles and runs successfully with a few missing features.
Things that work:
Things that partially work:
Things to rework:
static int i=3, as it will be set to
Things that don't work at all:
A program is a list of instructions separated by a newline, and the file MUST end with a newline.
Whitespace characters are omitted between instructions.
An instruction can be either:
Labels start with a dot and may not be longer than 20 characters. They may contain alphanumeric characters and underscores, but may not start with a number.
Mnemonics are listed in
data/opcode.list along with their description.
Comments start with a quote (single or double) or a pipe, and are ignored entirely.
Mnemonics and arguments are to be separated by comas or semicolons.
The interpreter acts like a 32-bit big-endian processor capable of handling integral values
int and decimal values
This processor has 256 32-bit registers, #00 to #ff which can hold either a float or an int.
Care must be taken by the user not to operate on the wrong data type, as the processor itself doesn't know what type of data is stored in the registers.
This emulated processor stores its program counter
PC in register #00, which should not be written directly.
This processor is attached to a stack which is where arguments are taken when not directly supplied, and where the return values are pushed.
This stack can contain up to 256 values, and will silently ignore illegal push or pop operations.
This stack follows the last in first out principle
LIFO, and handles a few basic operations:
This processor is attached to a memory management unit
MMU which handles virtual memory, which can be manipulated with
ext instructions or set at startup time.
Virtual memory types include:
The emulated processor supports interrupts, which can be triggered by hardware, the interpreter itself or by the program.
When an interrupt is triggered, the processor will push the
PC on the stack, followed by the interrupt data and the interrupt code. The processor will then jump to the interrupt handler.
Hardware interrupts may include:
Interpreter interrupts include:
Hardware interrupts may be subscribed or not, and by default are ignored. Interpreter interrupts will always be triggered when their conditions are met.
The interrupt handler MUST be set using the
inth instruction and point to executable memory, otherwise any interrupt will crash the program.
The program may raise a software interrupt with the
Instructions are variable-length instructions, and can be anywhere between 8-bit and 32-bit long.
Instructions fall in two categories, regular and extended instructions:
Instructions may use the following argument types: