User`s guide

Macros for Porting from VAX to Alpha or I64
D.1 Calculating Page-Size Values
Table D–1 Shift Values
Page size rightshift leftshift
512 bytes (VAX) -9 9
8K (OpenVMS Alpha or OpenVMS I64) -13 13
16K
1
-14 14
32K
1
-15 15
64K
1
-16 16
1
If a future OpenVMS Alpha or OpenVMS I64 system implements this architecturally-permitted
larger page size.
Typically, the application issues a call to $GETSYI (specifying the SYI$_
PAGESIZE item descriptor) to obtain the CPU-specific page size and then
compute other values from the page size that is returned.
The following conventions apply to the macros described in this section:
• If the destination operand is blank, the source operand is used as the
destination.
• All macros conditionalize code on the symbols VAXPAGE and BIGPAGE.
• Several macros allow for page-size-independent code on VAX systems with
the independent=YES argument. These macros generate code in which
I-stream fetches are changed to memory accesses. Because this is inherently
slower on a VAX system, the default value of the independent argument is
NO.
$BYTES_TO_PAGES
Converts a byte count to a page count.
Format
$BYTES_TO_PAGES source_bytcnt, dest_pagcnt, rightshift, roundup=YES,
quad=YES
Parameters
source_bytcnt
Source byte count.
dest_pagcnt
Destination of page count.
rightshift
Location of application-provided value to shift (in place of multiply). This value is
a function of the page size, as shown in Table D–1.
roundup=YES
If YES, page-size–1 is added to byte count before shifting; if NO, page count is
truncated. Any other value is treated as the user-specified address of the page-
size–1 value. Note that roundup=YES is incompatible with the presence of the
D–2 Macros for Porting from VAX to Alpha or I64