HP OpenVMS Systems

ask the wizard
Content starts here

Calling $crmpsc to create global section?

» close window

The Question is:

how can i make a global section in pascal - how i have to make the alignment .

The Answer is :

  You can create the global section in Pascal the same way you make
  it in every other OpenVMS language, by calling the $crmpsc system
  service.  You will want to become familiar with the parameter passing
  of your particular language, as well as with the OpenVMS Calling
  Standard -- once you understand this, calling most any service will
  be simple.
  If you have a software support contract for Pascal, you can use the
  database available via the support network or the Compaq Support Center
  to acquire various example programs in the prefered language(s).  A
  full C example of working with global sections is available at the
  Ask The Wizard website.
  As for alignment of sections on OpenVMS Alpha systems, "if you do not
  set the SEC$M_EXPREG flag, the inadr argument specifies the starting
  and ending virtual addresses of the region to be mapped. Addresses in
  system space are not allowed. The addresses must be aligned on
  CPU-specific pages; no rounding to CPU-specific pages occurs. The
  lower address of the inadr argument must be on a CPU-specific page
  boundary and the higher address of the inadr argument must be 1 less
  than a CPU-specific boundary, thus forming a range from lowest to
  highest address bytes. You can use the SYI$_PAGE_SIZE item code in
  the $GETSYI system service to set the inadr argument to the proper
  The core relevent portion of the Pascal code necessary to use the
  $crmpsc system service follows:
VAR  my_adr, sys_adr: ARRAY [1..2] OF int_pointer;
    (* Create and map the temporary global section *)
    name := 'GSEC';
    sec_flags := SEC$M_flag + SEC$M_flag + SEC$M_flag;
    sys_stat:= $CRMPSC( my_adr, sys_adr,, sec_flags, name,,,
                        0, 1,,,);

answer written or last revised on ( 9-JUN-2000 )

» close window