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.
Shr<t>
                                              Up Contents Index Back
──P-Code Instructions───────────────────────────────────────────────────────
 
  Syntax
 
  Shr<t>
 
  /* Shift Word Logical Right by n bits */
 
  Possible Instructions
 
  ShrW, ShrL
 
  See: P-Code Data Types
 
  Description
 
  Performs a right shift by one. It pops the top stack element off of the
  stack, shifts it right by one, and pushes the new value back onto the
  stack.
 
  Pseudocode equivalent:
 
  u2 = popW();
  u1 = popW();
  pushW(u1 >> u2);
 
  This can be generated as follows:
 
  uTest1 = uTest2 >> 1;    /* generates ShrW */
 
 
                                     -♦-