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.
SwapW
                                              Up Contents Index Back
──P-Code Instructions───────────────────────────────────────────────────────
 
  Syntax
 
  SwapW
 
  /* Swap the top two words on the on the stack. */
 
  Description
 
  Swaps the two top words on the stack by popping them off of the stack
  and then pushing them back on in opposite order.
 
  Pseudocode equivalent:
 
  unsigned w2, w1;
  w2 = Pop();
  w1 = Pop();
  Push(w2);
  Push(w1);
 
  This is generated in the following example:
 
  *lp = 100000l;
  wT = (int)*lp;           /* generates SwapW */
 
 
                                     -♦-