-- Environment.mesa (last edited by: Levin on: August 24, 1982 4:38 pm)

Environment: DEFINITIONS =

  BEGIN

  -- Fundamental properties of the OIS processor

  bitsPerWord: CARDINAL = 16;
  logBitsPerWord: CARDINAL = 4; -- logarithm of bitsPerWord

  bitsPerByte, bitsPerCharacter: CARDINAL = 8;
  logBitsPerByte, logBitsPerChar: CARDINAL = 3; -- logarithm of bitsPerByte

  bytesPerWord, charsPerWord: CARDINAL = bitsPerWord/bitsPerByte;
  logBytesPerWord, logCharsPerWord: CARDINAL = logBitsPerWord - logBitsPerByte;  -- logarithm of bytesPerWord

  wordsPerPage: CARDINAL = 256;
  bytesPerPage, charsPerPage: CARDINAL = wordsPerPage*bytesPerWord;
  logWordsPerPage: CARDINAL = 8; -- logarithm of wordsPerPage
  logBytesPerPage, logCharsPerPage: CARDINAL = logWordsPerPage + logBytesPerWord;  -- logarithm of bytesPerPage

  -- The following is the base pointer to the first 64K of virtual memory
  first64K: Base = LOOPHOLE[LONG[0]];

  maxINTEGER: INTEGER = LAST[INTEGER]; -- 32767
  minINTEGER: INTEGER = FIRST[INTEGER]; -- -32768
  maxCARDINAL: CARDINAL = LAST[CARDINAL]; -- 177777B
  maxLONGINTEGER: LONG INTEGER = LAST[LONG INTEGER]; -- 2147483647
  minLONGINTEGER: LONG INTEGER = FIRST[LONG INTEGER]; -- -2147483648
  maxLONGCARDINAL: LONG CARDINAL = LAST[LONG CARDINAL]; -- 4294967295

  Byte: TYPE = [0..255];
  Word: TYPE = [0..65535];

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

  Comparison: TYPE = MACHINE DEPENDENT {less(0), equal(1), greater(2)};

  -- Common types used throughout Pilot
  Base: TYPE = LONG BASE POINTER;

  BitAddress: TYPE = MACHINE DEPENDENT RECORD [
    word: LONG POINTER,
    reserved: [0..LAST[WORD]/bitsPerWord) ← 0,
    bit: [0..bitsPerWord)];

  Block: TYPE = RECORD [
    -- descriptor for arbitrary sequence of bytes
    blockPointer: LONG POINTER,
    startIndex, stopIndexPlusOne: CARDINAL];
  nullBlock: Block = [NIL, 0, 0];

  maxPagesInVM: CARDINAL = 65535;  -- Note that this is one less than the number of VM pages provided by the hardware; the highest numbered VM page is pre-empted for system purposes
  maxPagesInMDS: CARDINAL = 256;

  PageNumber: TYPE = [0..maxPagesInVM];
  PageOffset: TYPE = [0..maxPagesInVM];
  PageCount: TYPE = [0..maxPagesInVM];

  END.




LOG

Time: April 26, 1978  4:34 PM	By: McJones	Action: Created file
Time: May 3, 1978  1:46 PM	By: Lauer	Action: Merged contents of AltoDefs into file; changed name of file from "Processor".
Time: June 21, 1978  10:03 AM	By: Lauer	Action: Added maxINTEGER, minINTEGER, maxCARDINAL, maxLONGINTEGER, minLONGINTEGER
Time: July 21, 1978  11:31 AM	By: Lauer	Action: Moved type 'Block' from Stream to Environment
Time: August 14, 1978  10:26 AM	By: Horsley	Action: Used FIRST and LAST for number bounds
Time: March 7, 1979  10:31 AM	By: McJones	Action: Added Long; increased upper bound for PageNumber, PageOffset
Time: July 16, 1979  6:26 PM		By: Knutsen	Action: Added first64K, Base.
Time: January 25, 1980  5:46 PM		By: Forrest	AR1607: nullBlock added, AR1740: logBitsPerByte, logBitsPerWord added; change any branch of LONG NUMBER to use UNSPECIFIEDs.
Time: April 17, 1980  12:08 AM		By: Forrest	Action: added BitAddress.
Time: August 24, 1982 4:38 pm		By: Levin	Action: added Comparison.