Positron Compiler Documentation

Programming Considerations for 12-bit core Devices.

Positron8 · Revision 4.0.6.5 · PDF page 75

Because of the limited architecture of the 12-bit core microcontrollers, programs compiled for them by the compiler will be larger and slower than programs compiled for the 14-bit core devices. The two main programming limitations that will most likely occur are running out of RAM memory for variables, and running past the first 256 word limit for the library routines.

Even though the compiler arranges its internal system variables more intuitively than previous versions, it still needs to create temporary variables for complex expressions etc. It also needs to allocate extra RAM for use as a Software-Stack so that the BASIC program is still able to nest Gosubs up to 4 levels deep.

Some of the older devices only have 25 bytes of RAM so there is very little space for user variables on those devices. Therefore, use variables sparingly, and always use the appropriately sized variable for a specific task. i.e. Byte variable if 0-255 is required, Word variable if 0- 65535 required, Bit variables if a true or false situation is required. Try to alias any commonly used variables, such as loops or temporary stores etc.

As was mentioned earlier, 12-bit core microcontrollers can call only into the first half (256 words) of a code page. Since the compiler's library routines are all accessed by calls, they must reside entirely in the first 256 words of the code space. Many library routines, such as Busin, are quite large. It may only take a few routines to outgrow the first 256 words of code space. There is no work around for this, and if it is necessary to use more library routines that will fit into the first half of the first code page, it will be necessary to move to a 14-bit core device instead of the 12-bit core device.

No 24-bit, 32-bit or floating point variable support with 12-bit core devices. Because of the profound lack of RAM space available on 12-bit core devices, the Positron8 compiler does not allow 24-bit Long or 32-bit Dword type variables to be used. For 32-bit support, use one of the many enhanced 14-bit core, or 18F equivalent devices. Floating point variables are also not supported with 12-bit core devices.

View original PDF page 75Open page in PDFOriginal PDF page 75