home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / m2posx14 / include / portab.m2h < prev    next >
Encoding:
Text File  |  1994-05-31  |  17.7 KB  |  626 lines

  1. /*****************************************************************************
  2.  * CONFIGURATION SECTION
  3.  * If one of the following options is not available with the selected
  4.  * compiler, the corresponding macro is ignored.
  5.  * If one of the options is not selectable within the source text, but may be
  6.  * selected global, e.g. HM2: ``$i/$w'' --> __LONG_WHOLE__, the global
  7.  * setting and the macro have to correspond!
  8.  * Otherwise the options are set automatically corresponding to the following
  9.  * macros together with other default switches by the macros __DEF_SWITCHES__
  10.  * and __IMP_SWITCHES__ (see definitions at the end of this file).
  11.  *****************************************************************************/
  12.  
  13. /* function results on stack (#if 1) or in register D0/D1 (#if 0) */
  14. #if 0 /* HM2 */
  15. #define __RES_ON_STACK__
  16. #endif
  17.  
  18. /* CARDINAL/INTEGER are compatible with LONGCARD/INT (#if 1) or
  19.    SHORTCARD/INT (#if 0) */
  20. #if 1 /* HM2, MM2 */
  21. #define __LONG_WHOLE__
  22. #endif
  23.  
  24. /* REAL is compatible with LONGREAL (#if 1) or SHORTREAL (#if 0) */
  25. #if 0 /* HM2 */
  26. #define __LONG_REAL__
  27. #endif
  28.  
  29. /* Use register vars if __REG__ (#if 1) or not (#if 0) */
  30. #if 1 /* HM2, MM2 */
  31. #define __REG_VARS__
  32. #endif
  33.  
  34. /* Produce Rangechecks for __DEBUG__ (#if 1) or not (#if 0) */
  35. #if 0 /* HM2, MM2, TDIM2 */
  36. #define __RANGE_CODE__
  37. #endif
  38.  
  39. /* Produce Stackchecks for __DEBUG__ (#if 1) or not (#if 0) */
  40. #if 0 /* HM2, MM2, TDIM2 */
  41. #define __STACK_CODE__
  42. #endif
  43.  
  44. /* Produce Debugcode for __DEBUG__ (#if 1) or not (#if 0) */
  45. #if 0 /* HM2, MM2 */
  46. #define __DEBUG_CODE__
  47. #endif
  48.  
  49. /****************************************************************************
  50.  * one of the following macros specifying the compiler must be defined (with
  51.  * commandline option -D<macro>):
  52.  *
  53.  * LPRM2   : LPR-Modula, Version 1.4
  54.  * SPCM2   : SPC-Modula, Version 2.0 (treated like LPRM2)
  55.  * HM2     : Haenisch-Modula, Version >= 5.10, 13.4.93
  56.  * MM2     : Megamax-Modula, Version >= 4.2
  57.  * TDIM2   : TDI-Modula, Version 3.01
  58.  *****************************************************************************/
  59.  
  60.  
  61. #if !(   (defined LPRM2)\
  62.       || (defined SPCM2)\
  63.       || (defined MM2)\
  64.       || (defined HM2)\
  65.       || (defined TDIM2)\
  66.      )
  67. #  error *** compiler not (yet) supported
  68. #endif
  69.  
  70.  
  71.  
  72.  
  73. #if (defined LPRM2) || (defined SPCM2) || (defined MM2)   || (defined TDIM2) \
  74.  || (defined HM2)   || (defined FTLM2)
  75. #  define __GEMDOS__
  76. #endif
  77.  
  78. #if (defined TSM2_1) || (defined TSM2_2) || (defined TSM2_3)
  79. #  define TSM2
  80. #endif
  81.  
  82. #if (defined FSTM2) || (defined TSM2) || (defined LM2)
  83. #  define __PCDOS__
  84. #endif
  85.  
  86. #if 0
  87. #  define __UNIX__
  88. #endif
  89.  
  90. #if 0 /* sad, but true... */
  91. #  define ISOM2
  92. #endif
  93.  
  94.  
  95.  
  96. /* Within the declaration of a procedure, parameters may be of the procedure
  97.  * type itself (ISO), i.e. the procedure type may be used before fully
  98.  * declared.
  99.  */
  100. #define ISO_recursive_proc_decl \
  101. ((defined ISOM2) || (defined MM2) || (defined HM2))
  102.  
  103.  
  104. /* Values of equal procedure types may be tested for equality (ISO).
  105.  */
  106. #define ISO_proc_compare \
  107. ((defined ISOM2) || (defined MM2) || (defined HM2))
  108.  
  109.  
  110. /* Values of equal opaque types may be tested for equality (ISO).
  111.  */
  112. #define ISO_opaque_compare \
  113. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined LPRM2) || \
  114. (defined SPCM2))
  115.  
  116.  
  117. /* Opaque types may be declared as an imported type in the corresponding
  118.  * implementation module, i.e. they don't have to be fully specified (ISO).
  119.  */
  120. #define ISO_opaque_far_imp \
  121. ((defined ISOM2) || (defined LPRM2) || (defined SPCM2) || (defined HM2))
  122.  
  123.  
  124. /* Procedure constants are available (ISO).
  125.  */
  126. #define ISO_proc_const \
  127. ((defined ISOM2) || (defined FTLM2) || (defined TSM2))
  128.  
  129.  
  130. /* Array and record constructors are available (ISO).
  131.  */
  132. #define ISO_value_constructor \
  133. ((defined ISOM2) || (defined MM2) || (defined HM2))
  134.  
  135.  
  136. /* VAL is universal converting function (ISO), e.g. VAL(REAL,<cardexpr>)
  137.  * is equivalent to FLOAT(<cardexpr>).
  138.  */
  139. #define ISO_val \
  140. ((defined ISOM2) || (defined MM2) || (defined HM2))
  141.  
  142.  
  143. /* Identifiers may contain underscores (underlines?) at any position (ISO).
  144.  */
  145. #define ISO_underscore \
  146. ((defined ISOM2) || (defined MM2) || (defined HM2))
  147.  
  148.  
  149. /* Type PACKEDSET for sets of bits is available (ISO).
  150.  */
  151. #define ISO_packedset \
  152. ((defined ISOM2) || (defined HM2))
  153.  
  154.  
  155. /* ISO-procedures for arithmetic on pointers are available (ISO).
  156.  */
  157. #define ISO_ptr_arith \
  158. ((defined ISOM2))
  159.  
  160.  
  161. /* Functions may return arrays and records (ISO).
  162.  */
  163. #define ISO_struct_return \
  164. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined FTLM2))
  165.  
  166.  
  167. /* SET OF CHAR may be defined (ISO).
  168.  */
  169. #define ISO_char_set \
  170. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined TDIM2) || \
  171. (defined FTLM2))
  172.  
  173.  
  174. /* Type SYSTEM.LOC is available (ISO).
  175.  */
  176. #define ISO_loc \
  177. ((defined ISOM2) || (defined (MM2) || (defined HM2))
  178.  
  179.  
  180. /* Types COMPLEX and LONGCOMPLEX are available (ISO)
  181.  */
  182. #define ISO_complex 0
  183.  
  184.  
  185. /* Element 0 is most significant bit (only sets with no more than 32 elements).
  186.  */
  187. #define reverse_set \
  188. (defined FTLM2)
  189.  
  190.  
  191. /* Sets may have 32 elements.
  192.  */
  193. #define long_set \
  194. ((defined ISOM2) || (defined HM2)   || (defined SPCM2) || (defined MM2) || \
  195. (defined TDIM2) || (defined FTLM2))
  196.  
  197.  
  198. /* No colon necessary with tagless variants (PIM2).
  199.  */
  200. #define no_empty_tag_colon 0
  201.  
  202.  
  203. /* Only subranges are valid index types.
  204.  */
  205. #define only_subrange_index \
  206. ((defined LPRM2) || (defined SPCM2))
  207.  
  208.  
  209. /* Standard procedures MIN and MAX are not available.
  210.  */
  211. #define no_MIN_MAX 0
  212.  
  213.  
  214. /* Parameter type REF is available.
  215.  */
  216. #define has_REF \
  217. (defined MM2)
  218.  
  219.  
  220. /* Exportlist in definition module is necessary (PIM2).
  221.  */
  222. #define export 0
  223.  
  224.  
  225. /* Problems with reexported identifiers.
  226.  */
  227. #define no_reexport \
  228. (defined FTLM2)
  229.  
  230.  
  231. #define odd_arrays \
  232. ((defined MM2) || (defined TDIM2))
  233.  
  234.  
  235. #define align_byte_after_odd 0
  236.  
  237.  
  238.  
  239. /* Only parameters of type ARRAY OF CHAR are concerned */
  240. #if (defined TDIM2)
  241. #  define REF VAR
  242. #elif !has_REF
  243. #  define REF
  244. #endif
  245.  
  246. #if !ISO_packedset
  247. #  define PACKEDSET SET
  248. #endif
  249.  
  250.  
  251.  
  252. /* If there is a special notation for LONGCARD/INT-constants */
  253.  
  254. #if (defined LPRM2) || (defined SPCM2)
  255. #  define LC(_NUM) _NUM ## D
  256. #  define LIC(_NUM) _NUM ## D
  257. #elif (defined TDIM2)
  258. #  define LC(_NUM) LONGCARD(_NUM)
  259. #  define LIC(_NUM) LONGINT(_NUM)
  260. #else
  261. #  define LC(_NUM) _NUM
  262. #  define LIC(_NUM) _NUM
  263. #endif
  264.  
  265.  
  266. /* If there is a special notation for LONGREAL-constants */
  267.  
  268. #if (defined LPRM2) || (defined SPCM2)
  269. #  define LRC(_MANT,_EXP) _MANT ## D ## _EXP
  270. #elif (defined TDIM2)
  271. /* not for CONST-declarations, only single precision */
  272. #  define LRC(_MANT,_EXP) LONG(_MANT ## E ## _EXP)
  273. #else
  274. #  define LRC(_MANT,_EXP) _MANT ## E ## _EXP
  275. #endif
  276.  
  277.  
  278. #if no_empty_tag_colon
  279. #  define TAG_COLON
  280. #else
  281. #  define TAG_COLON :
  282. #endif
  283.  
  284.  
  285. /* If VAL has to be imported from SYSTEM */
  286.  
  287. #if (defined LPRM2) || (defined SPCM2)
  288. #  define VAL_INTRINSIC FROM SYSTEM IMPORT VAL;
  289. #else
  290. #  define VAL_INTRINSIC
  291. #endif
  292.  
  293.  
  294. #if (defined FTLM2) || (defined TDIM2)
  295. /* 32 bit --> 16 bit does not work with FTLM2 version 1.18 ! */
  296. #  define VAL(_TYPE,_EXPR) _TYPE(_EXPR)
  297. #endif
  298.  
  299.  
  300. /* Emulation of ISO-function CAST */
  301.  
  302. #if (defined ISOM2) || (defined MM2) || (defined HM2)
  303. #  define CAST_IMPORT FROM SYSTEM IMPORT CAST;
  304. #elif (defined LPRM2) || (defined SPCM2)
  305. #  define CAST_IMPORT
  306. #  define CAST(_TYPE,_EXPR) VAL(_TYPE,_EXPR)
  307. #else
  308. #  define CAST_IMPORT
  309. #  define CAST(_TYPE,_EXPR) _TYPE(_EXPR)
  310. #endif
  311.  
  312.  
  313.  
  314. /* Emulation of ISO-function INT */
  315.  
  316. #if (defined FTLM2)
  317. #  define INT(_EXPR) SHORT(LONGINT(_EXPR))
  318. #elif !((defined ISOM2) || (defined HM2))
  319. #  define INT(_EXPR) VAL(INTEGER,_EXPR)
  320. #endif
  321.  
  322.  
  323. /* If NEW and DISPOSE are not available */
  324.  
  325. #if (defined LPRM2)
  326. /* #  define Storage Heap */
  327. /* #  define ALLOCATE Allocate */
  328. /* #  define DEALLOCATE Deallocate */
  329. #  define NEW(_PTR) ALLOCATE(_PTR,SIZE(_PTR ## ^))
  330. #  define DISPOSE(_PTR) DEALLOCATE(_PTR,SIZE(_PTR ## ^))
  331. #elif (defined SPCM2)
  332. #  define NEW(_PTR) ALLOCATE(_PTR,SIZE(_PTR ## ^))
  333. /* #  define DISPOSE(_PTR) DEALLOCATE(_PTR) only with original 'Storage' */
  334. #  define DISPOSE(_PTR) DEALLOCATE(_PTR,SIZE(_PTR ## ^))
  335. #endif
  336.  
  337.  
  338. /* Arithmetic with pointers */
  339.  
  340. #if ISO_ptr_arith
  341. #  define PTR_ARITH_IMPORT FROM SYSTEM IMPORT ADDADR,SUBADR,DIFADR,MAKEADR;
  342. #elif (defined LPRM2) || (defined SPCM2)
  343. #  define PTR_ARITH_IMPORT
  344.  
  345. #  define ADDADR(_PTR,_ADD) (VAL(ADDRESS,_PTR)+VAL(ADDRESS,_ADD))
  346. #  define SUBADR(_PTR,_SUB) (VAL(ADDRESS,_PTR)-VAL(ADDRESS,_SUB))
  347. #  define DIFADR(_PTR1,_PTR2) (VAL(LONGINT,_PTR1)-VAL(LONGINT,_PTR2))
  348. #  define MAKEADR(_EXPR) VAL(ADDRESS,_EXPR)
  349. #elif (defined HM2)
  350. #  define PTR_ARITH_IMPORT
  351.  
  352. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+VAL(LONGCARD,_ADD))
  353. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-VAL(LONGCARD,_SUB))
  354. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  355. #  define MAKEADR(_EXPR) VAL(ADDRESS,_EXPR)
  356. #elif (defined MM2)
  357. #  define PTR_ARITH_IMPORT
  358.  
  359. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+VAL(LONGCARD,_ADD))
  360. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-VAL(LONGCARD,_SUB))
  361. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  362. #  define MAKEADR(_EXPR) ADDRESS(VAL(LONGCARD,_EXPR))
  363. #elif (defined FTLM2)
  364. #  define PTR_ARITH_IMPORT
  365.  
  366. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+LONGCARD(_ADD))
  367. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-LONGCARD(_SUB))
  368. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  369. #  define MAKEADR(_EXPR) ADDRESS(_EXPR)
  370. #elif (defined TDIM2)
  371. #  define PTR_ARITH_IMPORT
  372.  
  373. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+ADDRESS(_ADD))
  374. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-ADDRESS(_SUB))
  375. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  376. #  define MAKEADR(_EXPR) ADDRESS(_EXPR)
  377. #endif
  378.  
  379.  
  380. /* Imports for os-inline-calls */
  381.  
  382. #if (defined LPRM2) || (defined SPCM2)
  383. #  define OSCALL_IMPORT FROM SYSTEM IMPORT WORD, INLINE, SETREG, REG;
  384. #  define CODE INLINE
  385. #elif (defined MM2)
  386. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CALLSYS, CODE, LOAD, STORE, ASSEMBLER;
  387. #elif (defined HM2)
  388. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CODE, LOAD, STORE;
  389. #elif (defined TDIM2)
  390. #  define OSCALL_IMPORT FROM SYSTEM IMPORT PUSH, CODE, SETREG, REGISTER;
  391. #elif (defined FTLM2)
  392. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CODE, SETREG, GETREG;
  393. #elif (defined TSM2_1)
  394. #  define OSCALL_IMPORT FROM SYSTEM IMPORT Registers, Seg, Ofs; \
  395.                         FROM AsmLib IMPORT Dos;
  396. #elif (defined LM2)
  397. #  define OSCALL_IMPORT FROM SYSTEM IMPORT DOSCALL;
  398. #endif
  399. #define INLINE_CODE_IMPORT OSCALL_IMPORT
  400.  
  401.  
  402. /* Read/write from/to cpu registers
  403.  * _VAR : only (UN)SIGNEDWORD, (UN)SIGNEDLONG or ADDRESS, and simple,
  404.  *        local variable!
  405.  */
  406.  
  407. #if (defined LPRM2) || (defined SPCM2)
  408. #  define REGISTER_IMPORT FROM SYSTEM IMPORT REG, SETREG;
  409.  
  410. #  define SETREG(_REG,_EXPR) SETREG(_REG,VAL(LONGCARD,_EXPR))
  411. #  define GETINTREG(_REG,_VAR) _VAR:=VAL(INTEGER,REG(_REG))
  412. #  define GETSWREG(_REG,_VAR) _VAR:=VAL(INTEGER,REG(_REG))
  413. #  define GETCARDREG(_REG,_VAR) _VAR:=VAL(CARDINAL,REG(_REG))
  414. #  define GETUWREG(_REG,_VAR) _VAR:=VAL(CARDINAL,REG(_REG))
  415. #  define GETLREG(_REG,_VAR) _VAR:=REG(_REG)
  416. #  define GETREGADR(_REG,_VAR) _VAR:=VAL(ADDRESS,REG(_REG))
  417. #elif (defined MM2) || (defined HM2)
  418. #  define REGISTER_IMPORT FROM SYSTEM IMPORT LOAD, STORE;
  419.  
  420. #  define SETREG(_REG,_EXPR) LOAD(_EXPR,_REG)
  421. #  define GETINTREG(_REG,_VAR) STORE(_REG,_VAR)
  422. #  define GETSWREG(_REG,_VAR) STORE(_REG,_VAR)
  423. #  define GETCARDREG(_REG,_VAR) STORE(_REG,_VAR)
  424. #  define GETUWREG(_REG,_VAR) STORE(_REG,_VAR)
  425. #  define GETLREG(_REG,_VAR) STORE(_REG,_VAR)
  426. #  define GETREGADR(_REG,_VAR) STORE(_REG,_VAR)
  427. #elif (defined TDIM2)
  428. #  define REGISTER_IMPORT FROM SYSTEM IMPORT REGISTER, SETREG;
  429.  
  430. #  define SETREG(_REG,_EXPR) SETREG(_REG,_EXPR)
  431. #  define GETINTREG(_REG,_VAR) _VAR:=INTEGER(REGISTER(_REG))
  432. #  define GETSWREG(_REG,_VAR) _VAR:=INTEGER(REGISTER(_REG))
  433. #  define GETCARDREG(_REG,_VAR) _VAR:=CARDINAL(REGISTER(_REG))
  434. #  define GETUWREG(_REG,_VAR) _VAR:=CARDINAL(REGISTER(_REG))
  435. #  define GETLREG(_REG,_VAR) _VAR:=LONGCARD(REGISTER(_REG))
  436. #  define GETREGADR(_REG,_VAR) _VAR:=REGISTER(_REG)
  437. #elif (defined FTLM2)
  438. #  define REGISTER_IMPORT FROM SYSTEM IMPORT SETREG, GETREG;
  439.  
  440. #  define SETREG(_REG,_EXPR) SETREG(_REG,LONGCARD(_EXPR))
  441. /* GETREG works only with 16-bit-vars in version 1.18 !! */
  442. #  define GETINTREG(_REG,_VAR) GETREG(_REG,_VAR)
  443. #  define GETSWREG(_REG,_VAR) GETREG(_REG,_VAR)
  444. #  define GETCARDREG(_REG,_VAR) GETREG(_REG,_VAR)
  445. #  define GETUWREG(_REG,_VAR) GETREG(_REG,_VAR)
  446. #  define GETLREG(_REG,_VAR) GETREG(_REG,_VAR)
  447. #  define GETREGADR(_REG,_VAR) GETREG(_REG,_VAR)
  448. #endif
  449.  
  450.  
  451. #if (defined MM2)
  452. #  define REFADR CADR
  453. #else
  454. #  define REFADR ADR
  455. #  define CADR ADR
  456. #endif
  457.  
  458. #if (defined LPRM2) || (defined SPCM2)
  459. #  define PROCADR(_P) ADR(_P)
  460. #else
  461. #  define PROCADR(_P) CAST(ADDRESS,_P)
  462. #endif
  463.  
  464.  
  465. /* Various compiler options */
  466.  
  467. #if (defined MM2)
  468. /* B-: Remove module body during optimized linking if no procedures needed
  469.  * D-: Don't produce debug code
  470.  * E-: Don't produce procedure trace
  471.  * K+: Assignment <short> := <long> is possible
  472.  * L+: Produce procedure frames
  473.  * M-: Don't produce procedure names
  474.  * R-: Don't produce range checks
  475.  * S-: Don't produce stack checks
  476.  * T+: Enumerations in ascending order
  477.  * U+: Sets with no more than 32 elements in BITSET format
  478.  * W-: No warnings with REF-parameters
  479.  *
  480.  * I+/-: CARDINAL/INTEGER same as LONGCARD/LONGINT or SHORTCARD/SHORTINT
  481.  * Z+/-: Function results in register or on stack
  482.  */
  483. #  ifdef __RES_ON_STACK__
  484. #    ifdef __LONG_WHOLE__
  485. #      define __DEF_SWITCHES__ (*$I+,Z-*)
  486. #      define __IMP_SWITCHES__ (*$B-,K+,T+,U+,W-,I+,Z-*)
  487. #    else
  488. #      define __DEF_SWITCHES__ (*$I-,Z-*)
  489. #      define __IMP_SWITCHES__ (*$B-,K+,T+,U+,W-,I-,Z-*)
  490. #    endif
  491. #  else
  492. #    ifdef __LONG_WHOLE__
  493. #      define __DEF_SWITCHES__ (*$I+,Z+*)
  494. #      define __IMP_SWITCHES__ (*$B-,K+,T+,U+,W-,I+,Z+*)
  495. #    else
  496. #      define __DEF_SWITCHES__ (*$I-,Z+*)
  497. #      define __IMP_SWITCHES__ (*$B-,K+,T+,U+,W-,I-,Z+*)
  498. #    endif
  499. #  endif
  500. #  define __PROCFRAME_OFF__ (*$L-*)
  501. #  define __PROCFRAME_ON__ (*$L+*)
  502. #  define __DRIVER__ (*$B+*)
  503.  
  504. #ifdef __REG_VARS__
  505. #  define __REG__ (*$Reg*)
  506. #else
  507. #  define __REG__
  508. #endif
  509.  
  510. #  define __STACKCHECK_ON__ (*$S+*)
  511. #  define __STACKCHECK_OFF__ (*$S-*)
  512. #  define __STACKCHECK_PREV__ (*$S=*)
  513. #  define __RANGECHECK_ON__ (*$R+*)
  514. #  define __RANGECHECK_OFF__ (*$R-*)
  515. #  define __RANGECHECK_PREV__ (*$R=*)
  516. #  define __DEBUG_ON__ (*$D+,E+,M+*)
  517. #  define __DEBUG_OFF__ (*$D-,E-,M-*)
  518. #  define __DEBUG_PREV__ (*$D=,E=,M=*)
  519.  
  520. #elif (defined HM2)
  521. /* B-:
  522.  * C-: Don't produce range checks for CARDINAL-operations
  523.  * D-: Don't produce debug code
  524.  * E-: Don't produce entry code for local procedures
  525.  * G-: Strings don't need to be terminated by 0C
  526.  * H-: Produce warnings if using HM2-specific constructs
  527.  * I-: Don't initialize local vars with -1
  528.  * K-: Called procedure removes it's arguments
  529.  * L-: Don't use 4 bytes as the minimal storage for enumerations
  530.  * M-: Remove module body during optimized linking if no procedures needed
  531.  * N-: Don't produce range checks for REAL-operations
  532.  * P-: Produce procedure frames
  533.  * Q-: Warnings enabled
  534.  * S-: Don't produce stack checks
  535.  * T-: Don't produce index and range checks
  536.  * V-: Don't produce range checks on INTEGER/aritmetic operations
  537.  * W-: Don't use 2 bytes as the minimal storage for enumerations
  538.  * X-: Don't make static checks (RETURN, CASE)
  539.  * Y-: Don't produce runtime checks (RETURN, CASE)
  540.  */
  541. #  define __DEF_SWITCHES__ (*$K-*)
  542. #  define __IMP_SWITCHES__ (*$B-,$E-,$G-,$H-,$K-,$L-,$M-,$Q-,$W-,$X-*)
  543. #  define __PROCFRAME_OFF__ (*$P+*)
  544. #  define __PROCFRAME_ON__ (*$P-*)
  545. #  define __DRIVER__ (*$M+*)
  546.  
  547. #ifdef __REG_VARS__
  548. #  define __REG__ (*$R+*)
  549. #else
  550. #  define __REG__
  551. #endif
  552.  
  553. #  define __STACKCHECK_ON__ (*$S+*)
  554. #  define __STACKCHECK_OFF__ (*$S-*)
  555. #  define __STACKCHECK_PREV__ (*$S=*)
  556. #  define __RANGECHECK_ON__ (*$C+,$N+,$T+,$V+,$Y+*)
  557. #  define __RANGECHECK_OFF__ (*$C-,$N-,$T-,$V-,$Y-*)
  558. #  define __RANGECHECK_PREV__ (*$C=,$N=,$T=,$V=,$Y=*)
  559. #  define __DEBUG_ON__ (*$D+,$I+*)
  560. #  define __DEBUG_OFF__ (*$D-,$I-*)
  561. #  define __DEBUG_PREV__ (*$D=,$I=*)
  562.  
  563. #elif (defined TDIM2)
  564. /* N-: Don't produce nil checks on dereferencing of pointers
  565.  * P+: produce procedure frames
  566.  * Q+: Within a module use BSR instead of JSR
  567.  * R-: Don't produce range checks
  568.  * S-: Don't produce stack checks
  569.  * T-: Don't produce index checks
  570.  * V-: Don't produce overflow checks
  571.  */
  572. #  define __DEF_SWITCHES__
  573. #  define __IMP_SWITCHES__ (*$Q+*)
  574. #  define __PROCFRAME_OFF__ (*$P-*)
  575. #  define __PROCFRAME_ON__ (*$P+*)
  576. #  define __DRIVER__
  577.  
  578. #  define __REG__
  579.  
  580. #  define __STACKCHECK_ON__ (*$S+*)
  581. #  define __STACKCHECK_OFF__ (*$S-*)
  582. #  define __STACKCHECK_PREV__ (*$S=*)
  583. #  define __RANGECHECK_ON__ (*$N+,$R+,$T+,$V+*)
  584. #  define __RANGECHECK_OFF__ (*$N-,$R-,$T-,$V-*)
  585. #  define __RANGECHECK_PREV__ (*$N=,$R=,$T=,$V=*)
  586. #  define __DEBUG_ON__
  587. #  define __DEBUG_OFF__
  588. #  define __DEBUG_PREV__
  589.  
  590. #else
  591. #  define __DEF_SWITCHES__
  592. #  define __IMP_SWITCHES__
  593. #  define __PROCFRAME_OFF__
  594. #  define __PROCFRAME_ON__
  595. #  define __DRIVER__
  596. #  define __REG__
  597. #  define __STACKCHECK_ON__
  598. #  define __STACKCHECK_OFF__
  599. #  define __STACKCHECK_PREV__
  600. #  define __RANGECHECK_ON__
  601. #  define __RANGECHECK_OFF__
  602. #  define __RANGECHECK_PREV__
  603. #  define __DEBUG_ON__
  604. #  define __DEBUG_OFF__
  605. #  define __DEBUG_PREV__
  606. #endif
  607.  
  608. #ifdef __STACK_CODE__
  609. #  define __stack__ __STACKCHECK_ON__
  610. #else
  611. #  define __stack__ __STACKCHECK_OFF__
  612. #endif
  613. #ifdef __RANGE_CODE__
  614. #  define __range__ __RANGECHECK_ON__
  615. #else
  616. #  define __range__ __RANGECHECK_OFF__
  617. #endif
  618. #ifdef __DEBUG_CODE__
  619. #  define __debug__ __DEBUG_ON__
  620. #else
  621. #  define __debug__ __DEBUG_OFF__
  622. #endif
  623.  
  624. #define __DEBUG__ __range__ __stack__ __debug__
  625.  
  626.