-- Inline.Mesa  Edited by
-- Sandman on August 12, 1980  10:12 AM
-- Karlton on Mar 2, 1980 4:25 PM

DIRECTORY
  Mopcodes USING [zAND, zBLT, zBLTL, zDIV, zLDIV, zMUL, zOR, zPUSH, zSHIFT, zXOR];

Inline: DEFINITIONS =
  BEGIN OPEN Mopcodes;

  COPY: PROCEDURE [from: POINTER, nwords: CARDINAL, to: POINTER] = MACHINE CODE
    BEGIN zBLT END;

  LongCOPY: PROCEDURE [from: LONG POINTER, nwords: CARDINAL, to: LONG POINTER] =
    MACHINE CODE BEGIN zBLTL END;

  DIVMOD: PROCEDURE [num, den: CARDINAL] RETURNS [quotient, remainder: CARDINAL] =
    MACHINE CODE BEGIN zDIV; zPUSH END;

  PUSH: PROCEDURE RETURNS [WORD] = MACHINE CODE BEGIN zPUSH END;

  LDIVMOD: PROCEDURE [numlow: WORD, numhigh: CARDINAL, den: CARDINAL]
    RETURNS [quotient, remainder: CARDINAL] = MACHINE CODE BEGIN zLDIV; zPUSH END;

  LongCARDINAL: TYPE = LONG CARDINAL;

  LongNumber: TYPE = MACHINE DEPENDENT RECORD [
    SELECT OVERLAID * FROM
      lc => [lc: LONG CARDINAL],
      li => [li: LONG INTEGER],
      lu => [lu: LONG UNSPECIFIED],
      num => [lowbits, highbits: CARDINAL],
      ENDCASE];

  LongMult: PROCEDURE [CARDINAL, CARDINAL] RETURNS [product: LONG CARDINAL] =
    MACHINE CODE BEGIN zMUL; zPUSH END;

  LongDiv: PROCEDURE [num: LONG CARDINAL, den: CARDINAL] RETURNS [CARDINAL] =
    MACHINE CODE BEGIN zLDIV END;

  LongDivMod: PROCEDURE [num: LONG CARDINAL, den: CARDINAL]
    RETURNS [quotient, remainder: CARDINAL] = MACHINE CODE BEGIN zLDIV; zPUSH END;

  BitOp: TYPE = PROCEDURE [UNSPECIFIED, UNSPECIFIED] RETURNS [UNSPECIFIED];

  BITAND: BitOp = MACHINE CODE BEGIN zAND END;

  BITOR: BitOp = MACHINE CODE BEGIN zOR END;

  BITXOR: BitOp = MACHINE CODE BEGIN zXOR END;

  BITNOT: PROCEDURE [u: UNSPECIFIED] RETURNS [UNSPECIFIED] = INLINE
    BEGIN RETURN[BITXOR[u, 177777B]] END;

  BITSHIFT: PROCEDURE [value: UNSPECIFIED, count: INTEGER] RETURNS [UNSPECIFIED] =
    MACHINE CODE BEGIN zSHIFT END;

  LowHalf: PROCEDURE [u: LONG UNSPECIFIED] RETURNS [UNSPECIFIED] = INLINE
    BEGIN RETURN[LOOPHOLE[u, LongNumber].lowbits] END;

  HighHalf: PROCEDURE [u: LONG UNSPECIFIED] RETURNS [UNSPECIFIED] = INLINE
    BEGIN RETURN[LOOPHOLE[u, LongNumber].highbits] END;

  BytePair: TYPE = MACHINE DEPENDENT RECORD [high, low: [0..377B]];

  LowByte: PROCEDURE [u: UNSPECIFIED] RETURNS [UNSPECIFIED] = INLINE
    BEGIN RETURN[LOOPHOLE[u, BytePair].low] END;

  HighByte: PROCEDURE [u: UNSPECIFIED] RETURNS [UNSPECIFIED] = INLINE
    BEGIN RETURN[LOOPHOLE[u, BytePair].high] END;

  END...