Basics32.mesa
For Sun-3, Sun-4, and other big-endian, 32-bit processors
Copyright Ó 1985, 1988, 1989, 1991 by Xerox Corporation. All rights reserved.
Carl Hauser, July 11, 1988 3:10:35 pm PDT
JKF August 26, 1988 11:17:35 am PDT
Willie-s, August 5, 1991 5:01 pm PDT
Doug Wyatt, August 27, 1991 1:18 pm PDT
Michael Plass, September 27, 1991 9:30 am PDT
Commonly-used types and values
bitsPerWord: NAT ~ BITS[WORD32]; -- = 32, of course
bytesPerWord: NAT ~ BYTES[WORD32];
charsPerWord:
NAT ~ bytesPerWord;
logBitsPerWord: NAT ~ BITS[[0..bitsPerWord)];
logBytesPerWord: NAT ~ BITS[[0..bytesPerWord)];
logCharsPerWord:
NAT ~ logBytesPerWord;
RawWords:
TYPE ~
RECORD [
PACKED
SEQUENCE
COMPUTED
CARD
OF
WORD32];
Logic utilities
BITAND:
PROC [w1:
WORD32, w2:
WORD32]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITAND[w1, w2]] };
BITOR:
PROC [w1:
WORD32, w2:
WORD32]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITOR[w1, w2]] };
BITXOR:
PROC [w1:
WORD32, w2:
WORD32]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITXOR[w1, w2]] };
BITNOT:
PROC [w:
WORD32]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITNOT[w]] };
BITLSHIFT:
PROC [value:
WORD32, count: [0..bitsPerWord)]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITLSHIFT[value, count]] };
BITRSHIFT:
PROC [value:
WORD32, count: [0..bitsPerWord)]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITRSHIFT[value, count]] };
BITSHIFT:
PROC [value:
WORD32, count:
INT]
RETURNS [
WORD32]
~ INLINE { RETURN[Basics.BITSHIFT[value, count]] };