Source code for /engineering/bos/rewrite/DEFINES.HOriginal file DEFINES.H
   1 /*
   2 	BattleOS : Engage battling programs.
   3 
   4 	Copyright (C) 1993 Erich P Gatejen    ALL RIGHTS RESERVED
   5 
   6 
   7 	File     : DEFINES.H
   8 	Purpose  : Standard defines for all BattleOS code
   9 */
  10 
  11 /* Preclude multiple declarations */
  12 #ifndef __DEFINES_H
  13 #define	__DEFINES_H
  14 
  15 /* Common constants */
  16 #define   FALSE	0
  17 #define   TRUE      1
  18 
  19 #define   INTHI     32000     /* Highest value an integer can hold */
  20 #define   INTLOW   -32000     /* Lowest ( negative )		   */
  21 
  22 
  23 /* Define machine instruction tokens */
  24 #define   DAT       0    /* Data						 */
  25 #define	  MOV	    1	 /* Move                             */
  26 #define   CMP	    2    /* Compare                          */
  27 #define   JE	    3    /* Jump on =					 */
  28 #define   JB        4    /* Jump below					 */
  29 #define   JA        5    /* Jump above					 */
  30 #define   JMP       6    /* Jump						 */
  31 #define   INC	    7    /* Increment				      */
  32 #define   DEC       8    /* Decrement                        */
  33 #define   ADD       9    /* Add						 */
  34 #define   SUB      10    /* Subtract					 */
  35 #define   CALL	   11	 /* Call subroutine				 */
  36 #define   RET	   12	 /* Return 					 */
  37 #define   PUSH	   13	 /* Push stack					 */
  38 #define	  POP	   14	 /* Pop stack					 */
  39 
  40 /* Define BattleOS instruction tokens */
  41 #define   RND      16    /* Random number				 */
  42 #define   WT       17    /* Put trap					 */
  43 #define   TMR      18    /* Set timer 	                     */
  44 #define   HLT      19    /* Halt program till timer or trap  */
  45 #define   INT	   20    /* Interrupt service routine. !!NOT IMPLEMENTED!! */
  46 
  47 /* Register definitions	*/
  48 #define   AREGISTER			'A'
  49 #define   BREGISTER			'B'
  50 #define   CREGISTER			'C'
  51 #define   DREGISTER			'D'
  52 
  53 #define	  SREGISTER			'S'  // Stack pointer
  54 
  55 #define   PREGISTER			'P'  // Future use.  NOT IMPLEMENTED
  56 
  57 /* -- Define standard types */
  58 
  59 typedef	int	BOOLEAN;
  60 
  61 /* Define Operand Token */
  62 enum  OpToken { NOOPERAND = 0, REG = 1, RREFERENCE = 2, MEM = 3,
  63 		IMMEDIATE = 4, ERROROPERAND = 5 		};
  64 
  65 #endif