-- InlineDefs.Mesa  Edited by Sandman on June 30, 1980  4:56 PM
-- Copyright  Xerox Corporation 1979, 1980

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

InlineDefs: 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;

  BcplLongNumber: TYPE = MACHINE DEPENDENT RECORD [highbits, lowbits: CARDINAL];

  MesaToBcplLongNumber: PROCEDURE [LONG UNSPECIFIED] RETURNS [BcplLongNumber] =
    MACHINE CODE BEGIN zEXCH END;

  BcplToMesaLongNumber: PROCEDURE [BcplLongNumber] RETURNS [LONG UNSPECIFIED] =
    MACHINE CODE BEGIN zEXCH END;


  END...