home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1994-04-19 | 12.5 KB | 542 lines |
- DEFINITION MODULE PORTAB;
- __DEF_SWITCHES__
-
- (*
- Yet another system-dependent Module.
-
- UK __DATE__ __TIME__
- modified by hk
- *)
-
-
- #ifdef FTLM2
- FROM SYSTEM IMPORT BYTE,WORD,LONGWORD,ADDRESS;
- #else
- IMPORT SYSTEM;
- #endif
-
-
- (* fixed Types *)
-
- TYPE WORDSETRANGE = [0..15];
-
- #if (defined LPRM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(CARDINAL);
- MAXUNSIGNEDWORD = MAX(CARDINAL);
-
- MINSIGNEDWORD = MIN(INTEGER);
- MAXSIGNEDWORD = MAX(INTEGER);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = LONGINT;
-
- BYTESET = SYSTEM.BYTE;
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = ANYLONG;
- #elif (defined SPCM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(CARDINAL);
- MAXUNSIGNEDWORD = MAX(CARDINAL);
-
- MINSIGNEDWORD = MIN(INTEGER);
- MAXSIGNEDWORD = MAX(INTEGER);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = LONGINT;
-
- BYTESET = SYSTEM.BYTE;
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined HM2) || (defined XHM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(SHORTCARD);
- MAXUNSIGNEDWORD = MAX(SHORTCARD);
-
- MINSIGNEDWORD = MIN(SHORTINT);
- MAXSIGNEDWORD = MAX(SHORTINT);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = [0..255];
- SIGNEDBYTE = [-128..127];
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = SHORTCARD;
- SIGNEDWORD = SHORTINT;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = SYSTEM.LONG;
-
- BYTESET = PACKEDSET OF [0..7];
- WORDSET = PACKEDSET OF WORDSETRANGE;
- LONGSET = PACKEDSET OF [0..31];
- #elif (defined MM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(SHORTCARD);
- MAXUNSIGNEDWORD = MAX(SHORTCARD);
-
- MINSIGNEDWORD = MIN(SHORTINT);
- MAXSIGNEDWORD = MAX(SHORTINT);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = SHORTCARD;
- SIGNEDWORD = SHORTINT;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = SYSTEM.LONGWORD;
-
- BYTESET = SET OF SYSTEM.BITNUM[0..7];
- WORDSET = SET OF SYSTEM.BITNUM[0..15];
- LONGSET = SET OF SYSTEM.BITNUM[0..31];
- #elif (defined MSM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(CARDINAL);
- MAXUNSIGNEDWORD = MAX(CARDINAL);
-
- MINSIGNEDWORD = MIN(INTEGER);
- MAXSIGNEDWORD = MAX(INTEGER);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- (*
- UNSIGNEDBYTE = CHAR;
- SIGNEDBYTE = CHAR;
- ANYBYTE = CHAR;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = LONG;
-
- BYTESET = CHAR;
- *)
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined FSTM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = LONGINT;
-
- BYTESET = SYSTEM.BYTE;
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined SDSM2)
- (*
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
- *)
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGINT; (* no LONGCARD *)
- SIGNEDLONG = LONGINT;
- ANYLONG = LONGINT;
-
- BYTESET = SYSTEM.BYTE;
- WORDSET = SET OF [0..15];
- LONGSET = ANYLONG;
- #elif (defined ANAM2) || (defined XAM2)
- CONST MINUNSIGNED = MIN(CARDINAL);
- MAXUNSIGNED = MAX(CARDINAL);
-
- MINSIGNED = MIN(INTEGER);
- MAXSIGNED = MAX(INTEGER);
-
- TYPE UNSIGNED = CARDINAL;
- SIGNED = INTEGER;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = SYSTEM.SHORTWORD;
- SIGNEDWORD = SYSTEM.SHORTWORD;
- ANYWORD = SYSTEM.SHORTWORD;
-
- UNSIGNEDLONG = CARDINAL;
- SIGNEDLONG = INTEGER;
- ANYLONG = SYSTEM.WORD;
-
- BYTESET = SET OF [0..7];
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined TDIM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(CARDINAL);
- MAXUNSIGNEDWORD = MAX(CARDINAL);
-
- MINSIGNEDWORD = MIN(INTEGER);
- MAXSIGNEDWORD = MAX(INTEGER);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = SYSTEM.LONGWORD;
-
- BYTESET = SET OF [0..7];
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined FTLM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- MINUNSIGNEDWORD = MIN(CARDINAL);
- MAXUNSIGNEDWORD = MAX(CARDINAL);
-
- MINSIGNEDWORD = MIN(INTEGER);
- MAXSIGNEDWORD = MAX(INTEGER);
-
- MINUNSIGNEDLONG = MIN(LONGCARD);
- MAXUNSIGNEDLONG = MAX(LONGCARD);
-
- MINSIGNEDLONG = MIN(LONGINT);
- MAXSIGNEDLONG = MAX(LONGINT);
-
- MINCARD = MIN(CARDINAL);
- MAXCARD = MAX(CARDINAL);
-
- MININT = MIN(INTEGER);
- MAXINT = MAX(INTEGER);
-
- MINCHAR = MIN(CHAR);
- MAXCHAR = MAX(CHAR);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = BYTE;
- SIGNEDBYTE = BYTE;
- ANYBYTE = BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = LONGWORD;
-
- BYTESET = SET OF [0..7];
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined LM2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SYSTEM.BYTE;
- SIGNEDBYTE = SYSTEM.BYTE;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGINT;
- SIGNEDLONG = LONGINT; (* no LONGCARD *)
- ANYLONG = LONGINT;
-
- BYTESET = SET OF [0..7];
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined TSM2_1) || (defined TSM2_2)
- CONST MINUNSIGNED = MIN(LONGCARD);
- MAXUNSIGNED = MAX(LONGCARD);
-
- MINSIGNED = MIN(LONGINT);
- MAXSIGNED = MAX(LONGINT);
-
- TYPE UNSIGNED = LONGCARD;
- SIGNED = LONGINT;
-
- UNSIGNEDBYTE = SHORTCARD;
- SIGNEDBYTE = SHORTINT;
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = CARDINAL;
- SIGNEDWORD = INTEGER;
- ANYWORD = SYSTEM.WORD;
-
- UNSIGNEDLONG = LONGCARD;
- SIGNEDLONG = LONGINT;
- ANYLONG = SYSTEM.LONGWORD;
-
- BYTESET = SET OF [SHORTCARD(0)..SHORTCARD(7)];
- WORDSET = SET OF WORDSETRANGE;
- LONGSET = SET OF [0..31];
- #elif (defined GPM2)
- CONST MINUNSIGNED = MIN(CARDINAL);
- MAXUNSIGNED = MAX(CARDINAL);
-
- MINSIGNED = MIN(INTEGER);
- MAXSIGNED = MAX(INTEGER);
-
- TYPE UNSIGNED = CARDINAL;
- SIGNED = INTEGER;
-
- UNSIGNEDBYTE = [0..255];
- SIGNEDBYTE = [-128..127];
- ANYBYTE = SYSTEM.BYTE;
-
- UNSIGNEDWORD = [0..65535];
- SIGNEDWORD = [-32768..32767];
- ANYWORD = SIGNEDWORD;
-
- UNSIGNEDLONG = CARDINAL;
- SIGNEDLONG = INTEGER;
- ANYLONG = SYSTEM.WORD;
-
- BYTESET = SET OF ANYBYTE;
- WORDSET = SET OF ANYWORD;
- LONGSET = SET OF [0..31];
- #endif
-
- (* for open Arrays *)
-
- #if (defined FSTM2) || (defined ANAM2) || (defined LPRM2) || \
- (defined SPCM2) || (defined HM2) || (defined TSM2_1) || \
- (defined TSM2_2) || (defined LM2) || (defined TDIM2) || \
- (defined GPM2)
- TYPE ANYTYPE = SYSTEM.BYTE;
- #elif (defined FTLM2)
- TYPE ANYTYPE = BYTE;
- #elif (defined ISOM2) || (defined MM2)
- TYPE ANYTYPE = SYSTEM.LOC;
- #else
- TYPE ANYTYPE = SYSTEM.WORD;
- #endif
-
- (* avoiding SYSTEM.ADDRESS *)
-
- #ifdef FTLM2
- TYPE ANYPOINTER = ADDRESS;
- #else
- TYPE ANYPOINTER = SYSTEM.ADDRESS;
- #endif
-
- (* all Purpose Procedure Type *)
-
- TYPE ANYPROC = PROCEDURE(ANYPOINTER);
-
- (* C-compatible NIL *)
-
- #if (defined TDIM2)
- CONST NULL = SYSTEM.NULL;
- #elif (defined LM2)
- CONST NULL = 0H:0H;
- #elif (defined FTLM2)
- CONST NULL = ADDRESS(LONGCARD(0));
- #elif (defined FSTM2)
- VAR NULL: ANYPOINTER;
- #else
- CONST NULL = NIL;
- #endif
-
- END PORTAB.
-