Arrays or records passed by value are pushed onto the stack if their size is at most 4 bytes. Otherwise the address of the record is pushed. The callee is responsible for making a local copy of the parameter to preserve the semantic of the call. Records passed by reference occupy 8 bytes for the record's address and its type tag. Array passed by references occupy only 4 bytes for the address of the array.
Floating-point values are pushed onto the stack regardless whether they are of type REAL or LONGREAL. For reference parameters the address of the variable is passed.
For open arrays more than the address of the array is needed in order to perform range checking and address computations. For each dimension of an open array its length is pushed onto the stack. Thus passing an array with n dimensions requires to push n+1 values. The lengths are pushed in the order of the declaration. Consider the following array a:
a: ARRAY 1,2,3 OF INTEGER;For this array the lengths will be pushed in the order shown, i.e. 1 is pushed first and 3 is pushed last. The lengths are followed by the address of the array.
The following table lists the size of the types supported by MPW Oberon:
| Type | Bytes | Range |
|---|---|---|
| SHORTINT | 1 | -128..127 |
| BYTE | 1 | 0..255 |
| INTEGER | 2 | -32,768..32,767 |
| LONGINT | 4 | -2,147,483,648..2,147,483,647 |
| REAL | 8 | |
| LONGREAL | 10/12 | |
| SET | 4 | - |
| address | 4 | - |