Variables special behaviors

Language reference ›› Variables ››
Parent Previous Next

With PMP, some variables types may behave quite differently from standard Pascal rules:


RECORD variables:

They must use a declared type in a TYPE section before to be used.

Direct variable declaration as RECORD is not allowed in PMP.

RECORD types cannot contain a case statement (polymorphic records) and cannot contain nested records (only one level of simple-typed fields).


CHAR variables:

They are strictly equivalent to a BYTE type in non-strict mode.

A single character literal is always treated as a BYTE (Except for WRITE/WRITELN statements).


Pointer variables:

Pointers are implemented but features are limited to a subset of the standard Pascal features in the current version of PMP (future development in the to-do list).

Pointers may be defined as ROM pointers, to point to some ROM constant.


Arrays and strings:

For Enhanced Mid-Range and High-Performance processors, RAM arrays and strings may cross a RAM bank boundary and contain more than 256 elements.

For other processors they cannot cross a RAM bank boundary, so PMP may flag a memory overflow if one cannot fit in one bank.

CODE (ROM) arrays may contain more than 256 elements, regardless of the processor family.


Arrays:

They are limited to one dimension.

Low and high bounds may be defined as wanted.

For Enhanced Mid-Range and High-Performance the maximum total size is 64K bytes (if the processor can hold it!).  

For other processors the maximum total size of a RAM array is theoretically 256 bytes, but it is limited because they must be contained in one page.


Strings:

They are limited to 255 characters.

The actual size is stored in the byte at index 0, first character is at byte index 1. High bound may be defined as wanted.