Source code for /engineering/bos/rewrite/IBUILD.HOriginal file IBUILD.H
   1 /*
   2 	BattleOS : Engage battling programs.
   3 
   4 	Copyright (C) 1993 Erich P Gatejen    ALL RIGHTS RESERVED
   5 
   6 
   7 	File     : IBUILD.H
   8 	Purpose  : Header file for the BattleOS Assembler Instruction builder
   9         	   module	
  10 
  11 */
  12 
  13 // -- Includes --------------------------------------------------------------
  14 #include "binst.h"
  15 
  16 // Enumerate the possible errors from the following class(es)
  17 enum  InstrError { NOERROR            = 0,
  18 		   UNKOWNMNEMONIC     = 6,
  19 		   LEFTOPINVALID      = 7,
  20 		   RIGHTOPINVALID     = 8,
  21 		   LEFTNOTALLOWED     = 9,
  22 		   RIGHTNOTALLOWED    = 10,
  23 		   NOOPERANDS	      = 11,
  24 		   LEFTOPONLY	      = 12
  25 
  26 };
  27 
  28 
  29 // Define instruction builder class
  30 class IBuilder {
  31 
  32    Instr   Instruction;	// Working instruction
  33    char	   Binary[15];	// Instruction binary image
  34 
  35    BOOLEAN MValid;	// Flags for valid componants
  36    BOOLEAN LValid;
  37    BOOLEAN RValid;
  38 
  39  public:
  40 
  41    // Constructor
  42    IBuilder( void );
  43 
  44    // Information members
  45    BOOLEAN  IsValid(  void );
  46    BOOLEAN  IsMnemonic( char* Text );
  47    char*    BinaryIs( void );
  48 
  49    // Loader members
  50    InstrError  LoadMnemonic(    char*  Text );
  51    InstrError  LoadLeftOperand(  signed Value, unsigned  OpToken );
  52    InstrError  LoadRightOperand( signed Value, unsigned  OpToken );
  53    InstrError  LoadTaunt( unsigned TauntNumber );
  54 
  55    Instr*  BondInstr( void );
  56 
  57 }; // end IBuilder