DIRECTORY
Basics USING [bitsPerByte, bitsPerWord, Byte, bytesPerWord, logBitsPerByte, logBitsPerWord, logBytesPerWord, LongNumber, Word],
PrincOps USING [BitAddress, bytesPerPage, logBytesPerPage, logWordsPerPage, PageCount, PageNumber, wordsPerPage],
VM USING [AddressForPageNumber, PageNumberForAddress];
BEGIN
Fundamental properties of the Mesa processor
bitsPerWord: CARDINAL = Basics.bitsPerWord;
logBitsPerWord: CARDINAL = Basics.logBitsPerWord; -- logarithm of bitsPerWord
bitsPerByte, bitsPerCharacter: CARDINAL = Basics.bitsPerByte;
logBitsPerByte, logBitsPerChar: CARDINAL = Basics.logBitsPerByte; -- logarithm of bitsPerByte
bytesPerWord, charsPerWord: CARDINAL = Basics.bytesPerWord;
logBytesPerWord, logCharsPerWord: CARDINAL = Basics.logBytesPerWord; -- logarithm of bytesPerWord
wordsPerPage: CARDINAL = PrincOps.wordsPerPage;
bytesPerPage, charsPerPage: CARDINAL = PrincOps.bytesPerPage;
logWordsPerPage: CARDINAL = PrincOps.logWordsPerPage; -- logarithm of wordsPerPage
logBytesPerPage, logCharsPerPage: CARDINAL = PrincOps.logBytesPerPage; -- logarithm of bytesPerPage
Not in PilotBridge version: first64K, Base, maxPagesInMDS, maxPagesInVM
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 = Basics.Byte;
Word: TYPE = Basics.Word;
Long, LongNumber:
TYPE = Basics.LongNumber;
BitAddress:
TYPE = PrincOps.BitAddress;
Block:
TYPE =
RECORD [
descriptor for arbitrary sequence of bytes
blockPointer: LONG POINTER TO PACKED ARRAY [0..0) OF Byte,
startIndex, stopIndexPlusOne: CARDINAL];
nullBlock: Block = [NIL, 0, 0];
PageNumber:
TYPE = PrincOps.PageNumber;
Note that 2**24-2 is one less than the highest numbered VM page
provided by the hardware; the highest numbered VM page, 2**24-1, is
pre-empted for system purposes.
firstPageNumber: PageNumber = 0;
lastPageNumber: PageNumber = 16777214 --2**24-2--;
PageOffset:
TYPE = PageNumber;
firstPageOffset: PageOffset = firstPageNumber;
lastPageOffset: PageOffset = lastPageNumber;
PageCount:
TYPE = PrincOps.PageCount
--[0..2**24-1]--;
firstPageCount: PageCount = 0;
lastPageCount: PageCount = lastPageNumber+1;
PageNumber/LONG POINTER conversions
LongPointerFromPage:
PROCEDURE [page: PageNumber]
RETURNS [LONG POINTER] = INLINE {RETURN[VM.AddressForPageNumber[page]]};
PageFromLongPointer:
PROCEDURE [pointer:
LONG
POINTER]
RETURNS [PageNumber] = INLINE {
RETURN[VM.PageNumberForAddress[pointer]]};
END.