-- EmulatorTest.mesa     3-Dec-81 15:59:14 by JGS

-- Test program to exercise the the Mesa emulator of a PrincOps machine.

DIRECTORY
  Mopcodes;

EmulatorTest: DEFINITIONS =

  BEGIN OPEN Mopcodes;
 
  InitHelper: PROC;
  varOne: CARDINAL;
  varOneTwo: LONG CARDINAL;
  Proc: PROCEDURE RETURNS [self: PROC];
  
  REC: PROC RETURNS [CARDINAL] = MACHINE CODE {zREC};
  REC2: PROC RETURNS [LONG CARDINAL] = MACHINE CODE {zREC2};
  DIS: PROC [CARDINAL] = MACHINE CODE {zDIS};
  DIS2: PROC [LONG CARDINAL] = MACHINE CODE {zDIS2};
  EXCH: PROC [a, b: CARDINAL] RETURNS [c, d: CARDINAL] = MACHINE CODE {zEXCH};
  DEXCH: PROC [a, b: LONG CARDINAL] RETURNS [c, d: LONG CARDINAL] =
    MACHINE CODE {zDEXCH};
  DUP: PROC [CARDINAL] RETURNS [a, b: CARDINAL] = MACHINE CODE {zDUP};
  DDUP: PROC [LONG CARDINAL] RETURNS [a, b: LONG CARDINAL] = MACHINE CODE {zDDUP};
  EXDIS: PROC [a, b: CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zEXDIS};
  NEG: PROC [CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zNEG};
  INC: PROC [CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zINC};
  DEC: PROC [CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zDEC};
  DINC: PROC [LONG CARDINAL] RETURNS [LONG CARDINAL] = MACHINE CODE {zDINC};
  DBL: PROC [CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zDBL};
  DDBL: PROC [LONG CARDINAL] RETURNS [LONG CARDINAL] = MACHINE CODE {zDDBL};
  TRPL: PROC [CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zTRPL};
  ANDOp: PROC [a, b: CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zAND};
  IOR: PROC [a, b: CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zIOR};
  ADD: PROC [a, b: CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zADD};
  SUB: PROC [a, b: CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zSUB};
  DADD: PROC [a, b: LONG CARDINAL] RETURNS [LONG CARDINAL] = MACHINE CODE {zDADD};
  DSUB: PROC [a, b: LONG CARDINAL] RETURNS [LONG CARDINAL] = MACHINE CODE {zDSUB};
  ACD: PROC [a: CARDINAL, b: LONG CARDINAL] RETURNS [LONG CARDINAL] =
    MACHINE CODE {zACD};
  ADC: PROC [a: LONG CARDINAL, b: CARDINAL] RETURNS [LONG CARDINAL] =
    MACHINE CODE {zADC};
  MUL: PROC [a, b: CARDINAL] RETURNS [c, d: CARDINAL] = MACHINE CODE {zMUL; zREC};
  DCMP: PROC [a, b: LONG CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zDCMP};
  UDCMP: PROC [a, b: LONG CARDINAL] RETURNS [CARDINAL] = MACHINE CODE {zUDCMP};
  SHIFT: PROC [a: CARDINAL, b: INTEGER] RETURNS [CARDINAL] = MACHINE CODE {zSHIFT};


  END...