P-Code Instructions (pcode.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LdgA<n>
                                              Up Contents Index Back
──P-Code Instructions───────────────────────────────────────────────────────
 
  Syntax
 
  LdgA<n>
 
  /* Push address of the global variable onto the stack */
 
  Possible Instructions
 
  LdgA0...LdgA4, LdgAb
 
  See: P-Code Operands
 
  Description
 
  Load the near address of the specified global variable onto the stack.
  The global variable specified is relative to an internal p-code table of
  function references (for LngdA0...LdngA4) or an internal table of
  segment references (for LdgAb).
 
  This can be generated by assigning a pointer to a global variable. For
  example,
 
  pTest = &wGlobal
 
  Pseudocode equivalent:
 
  // pfh = pointer-to-function: an internal p-code table
  //  of references
  PushW(*(pfh + <n>));
 
  OR
 
  // pspi = pointer-to-segment: an internal p-code table
  // of references
  PushW(*(pspi + <n>));
 
  If the index <n> is specified as an immediate operand, then the global
  variable address may be near or far. This results in either one or two
  words on the stack.
 
  The decision is made by the compiler and is implemented at run time
  using a range check on the index.
 
 
                                     -♦-