28.06.2013 Views

ISO Pascal reference manual

ISO Pascal reference manual

ISO Pascal reference manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6<br />

Subrange<br />

Parameters of subrange types are pushed as 32-bit items, and if the lower<br />

bound of an integer subrange is negative then the object is sign-extended to<br />

32-bits if necessary (ie. if the basic storage size is less than 4 bytes); all other<br />

parameters of subrange type are zero-extended if necessary.<br />

Pointer<br />

Parameters which are pointers to any type are pushed as 32-bit unsigned<br />

objects.<br />

Real<br />

Parameters of type Real are pushed as 64-bit (8-byte) floating- point<br />

quantities, using the instruction form `MOVL < par > , TOS'.<br />

Record<br />

For Record types, the item which is pushed on the stack for a value<br />

parameter is the address of the actual record parameter (i.e. of a variable,<br />

since there are no record-type expressions in <strong>Pascal</strong>). It is the responsibility<br />

of the called procedure to copy the parameter value, via this pointer, into its<br />

own stack frame so that the original record is not modified by the called<br />

procedure (as required by <strong>Pascal</strong> semantics).<br />

Non-conformant array<br />

As for VAR parameters, the address of the first element of the actual array<br />

parameter is pushed. It is the responsibility of the called procedure to copy<br />

the array via this pointer into its own stack frame so that the original array<br />

is not modified. For a non-conformant array no size information need be<br />

passed since the size is fixed by the type of the array.<br />

Conformant array<br />

The information pushed on the stack for a value-type conformant array<br />

parameter is exactly the same as that for a conformant array parameter<br />

passed as VAR. It is the responsibility of the called procedure to copy the<br />

array into its own stack frame so as to prevent modification of the actual<br />

parameter. The size and bounds information passed is used to control this<br />

copying operation.<br />

38 <strong>Pascal</strong> Issue I

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!