GPC is the scripting language for CronusMAX device. Much of its syntax was borrowed from C language, including basic keywords and structure, with the addition of some unique GPC-specific features. The goal of the language is to be an easy and fast way of programming the CronusMAX device. This document consists primarily of the language reference, but also contains explanations and examples of GPC’s major functions and features.
The CronusMAX device is based on a bytecode-compiled system, as such every GPC source code must be translated to an intermediate representation, known as bytecode, before it can be executed. The bytecode is a form of instruction set designed for efficient execution by a software interpreter, also known as Virtual Machine. A virtual machine (VM) is a software based, fictive computer. The GPC Virtual Machine is based on specifications of a hypothetical computer, which architecture and functions was highly optimized for the specific tasks it executes.
GPC Development and Execution Process
The GPC VM is a stack machine. In real machines stack CPUs were used for early computers and may still being used in simple devices today. Due to the GPC VM be running on a 16MHz CPU, the VM was highly optimized for performance in order to reaches the necessary speed to process all the data exchanged between the controller and the console. The GPC VM is fast enough to send data to the console without delays, on the Gtuner Monitor you can check the CPU load, any value below 80% is good and means the processor is able to perform all its tasks on time. In favor of performance the error checks are limited to only what is absolutely necessary, so it is very important for the programmer have knowledge about the fundamentals and limitations of the GPC developing process.
- Real CPU: Atmel Microcontroller @ 16MHz
- Real Memory: 8184 bytes
- Real Flash: 130944 bytes
- VM Type: Stack Machine
- VM Max Bytecode: 4092 bytes
- VM Stack Memory: 128 words (256 bytes)