Managing the Storage Area

The interpreter Storage Area is a block of memory that can be used to store and later access 32 bit values. Instructions exist for writing values to the Storage Area and retrieving values from the Storage Area. Attempting to read a value from a storage location that has not previously had a value written to it will yield unpredictable results.

Read Store

RS[ ]

Code Range

0x43

Pops

location: Storage Area location (ULONG)

Pushes

value: Storage Area value (ULONG)

Gets

Storage Area value


This instruction reads a 32 bit value from the Storage Area location popped from the stack and pushes the value read onto the stack. It pops an address from the stack and pushes the value found in that Storage Area location to the top of the stack. The number of available storage locations is specified in the maxProfile table in the font file.

Example:

The effect of the RS instruction is to push the value 0x1B of the Storage Area onto the Stack.

Write Store

WS[ ]

Code Range

0x42

Pops

value: Storage Area value (ULONG)

location: Storage Area location (ULONG)

Pushes

– -

Sets

Storage Area value


This instruction writes a 32 bit value into the storage location indexed by locations. It works by popping a value and then a location from the stack. The value is placed in the Storage Area location specified by that address. The number of storage locations is specified in the maxProfile table in the font file.

Example:

Write the value 0x0000 0118 to location 3A in the Storage Area.