Vmstatus – AMT Datasouth PAL User Manual
Page 201
![background image](/manuals/733850/201/background.png)
195
vmstatus
vmstatus
Description
Returns the number of bytes still available for allocation within the interpreter's virtual memory as
well as the total size of the virtual memory.
Usage
vmstatus
ReservedInt UsedInt MaxInt
ReservedInt
Integer. Reserved for historical compatibility. Current release PAL interpreters
always return zero for this value.
UsedInt
Integer. Number of virtual memory bytes currently in use.
MaxInt
Integer. Total virtual memory bytes within printer.
Comments
PAL stores all user data and procedures into a reserved area within the printer's memory called
virtual memory. PAL refers to this memory space as virtual memory because the PAL programmer
has only indirect access to the memory. PAL allows the programmer to store data and procedures
into this memory space, however PAL controls the actual placement of this information into the
virtual memory. The PAL programmer cannot directly manipulate the virtual memory area itself.
The PAL interpreter requires its own memory in order to save control information related to the
operation of the printer as well as management information relating to the PAL programmer's data
and procedures. Once PAL has allocated part of the printer's memory for this purpose, PAL
allocates all of the remaining memory for use as the PAL virtual memory.
The vmstatus MaxInt value indicates the total size, in bytes, of the virtual memory area. This
value will reflect the total amount of memory installed in the printer less the amount of memory the
PAL interpreter requires.
The UsedInt value indicates the total number of bytes which the PAL programmer currently has in
use within the virtual memory area. Even when the programmer has no data or procedures stored
within the printer, UsedInt will still show virtual memory in use by the operand stack and various
other PAL language data structures. Since PAL dynamically grows and shrinks data areas like the
operand stack to meet the user's requirements, PAL allocates these data areas within virtual
memory.
Hints
The PAL sequence "vmstatus exch sub exch pop" will leave on the top of the stack the total
number of bytes still available for allocation within virtual memory. "exch sub" exchanges
UsedInt and MaxInt on the top of the stack and then subtracts UsedInt from MaxInt to determine
the numbers of bytes not used. "exch pop" then exchanges the result with ReservedInt on the top
of the stack and discards ReservedInt from the stack. This leaves only the number of bytes
available on the top of the stack.
PAL manages the virtual memory space in an extremely dynamic manner. In addition, the size of
PAL data objects can vary from printer to printer. Therefore, the programmer should use the