[avida-cvs] avida CVS commits: /current/source/cpu hardware_4stack.cc hardware_4stack.hh hardware_cpu.cc hardware_cpu.hh hardware_util.cc hardware_util.hh /current/source/main analyze.cc config.cc

mercere99 avida-cvs at alife.org
Sun May 25 17:46:32 PDT 2003


mercere99		Sun May 25 09:46:32 2003 EDT

  Modified files:              
    /avida/current/source/cpu	hardware_4stack.cc hardware_4stack.hh 
                             	hardware_cpu.cc hardware_cpu.hh 
                             	hardware_util.cc hardware_util.hh 
    /avida/current/source/main	analyze.cc config.cc 
  Log:
  Working toward setting up Avida to generate an instruction set file if none
  exists.  I've attached 60 character (or less) descriptions to each of the
  default instructions, and attached a flag to all instructions declaring if
  they are default.
  
  Next step in this process is to actually print out the default instruction
  set if it doesn't exist, but first we may want to clean up more of the
  instruction set/lib code.
  
  
-------------- next part --------------
Index: avida/current/source/cpu/hardware_4stack.cc
diff -u avida/current/source/cpu/hardware_4stack.cc:1.4 avida/current/source/cpu/hardware_4stack.cc:1.5
--- avida/current/source/cpu/hardware_4stack.cc:1.4	Fri May 23 04:43:22 2003
+++ avida/current/source/cpu/hardware_4stack.cc	Sun May 25 09:46:29 2003
@@ -263,8 +263,7 @@
     cInstEntry4Stack("nop-B",     &cHardware4Stack::Inst_Nop),
     cInstEntry4Stack("nop-C",     &cHardware4Stack::Inst_Nop),
 
-    // Added "map-null" for use in analyze mode. -- kgn
-    cInstEntry4Stack("map-null",  &cHardware4Stack::Inst_Nop),
+    cInstEntry4Stack("NULL",  &cHardware4Stack::Inst_Nop),
     cInstEntry4Stack("nop-X",     &cHardware4Stack::Inst_Nop),
     cInstEntry4Stack("if-equ-0",  &cHardware4Stack::Inst_If0),
     cInstEntry4Stack("if-not-0",  &cHardware4Stack::Inst_IfNot0),
Index: avida/current/source/cpu/hardware_4stack.hh
diff -u avida/current/source/cpu/hardware_4stack.hh:1.2 avida/current/source/cpu/hardware_4stack.hh:1.3
--- avida/current/source/cpu/hardware_4stack.hh:1.2	Mon May 19 12:30:06 2003
+++ avida/current/source/cpu/hardware_4stack.hh	Sun May 25 09:46:30 2003
@@ -107,6 +107,8 @@
   ~cHardware4Stack();
   void Recycle(cOrganism * new_organism, cInstSet * in_inst_set);
   static cInstLibBase *GetInstLib();
+  static cString GetDefaultInstFilename() { return "inst_lib.4stack"; }
+  static void WriteDefaultInstSet() { ; }
 
   void Reset();
   void SingleProcess(std::ostream * trace_fp=NULL);
Index: avida/current/source/cpu/hardware_cpu.cc
diff -u avida/current/source/cpu/hardware_cpu.cc:1.47 avida/current/source/cpu/hardware_cpu.cc:1.48
--- avida/current/source/cpu/hardware_cpu.cc:1.47	Fri May 23 04:43:22 2003
+++ avida/current/source/cpu/hardware_cpu.cc	Sun May 25 09:46:30 2003
@@ -241,9 +241,10 @@
 cInstLibCPU *cHardwareCPU::s_inst_slib = cHardwareCPU::initInstLib();
 cInstLibCPU *cHardwareCPU::initInstLib(void){
   struct cNOPEntryCPU {
-    cNOPEntryCPU(const cString &name, int nop_mod):name(name), nop_mod(nop_mod){}
     cString name;
     int nop_mod;
+    cNOPEntryCPU(const cString &name, int nop_mod)
+      : name(name), nop_mod(nop_mod) {}
   };
   static const cNOPEntryCPU s_n_array[] = {
     cNOPEntryCPU("nop-A", REG_AX),
@@ -251,10 +252,15 @@
     cNOPEntryCPU("nop-C", REG_CX)
   };
 
-  struct cInstEntryCPU {
-    cInstEntryCPU(const cString &name, tHardwareCPUMethod function):name(name), function(function){}
-    cString name;
-    tHardwareCPUMethod function;
+  struct cInstEntryCPU { 
+    const cString name;
+    const tHardwareCPUMethod function;
+    const bool is_default;
+    const cString desc;
+
+    cInstEntryCPU(const cString & _name, tHardwareCPUMethod _fun,
+		  bool _def=false, const cString & _desc="")
+      : name(_name), function(_fun), is_default(_def), desc(_desc) {}
   };
   static const cInstEntryCPU s_f_array[] = {
     /*
@@ -262,30 +268,39 @@
     in the same order in cInstEntryCPU s_f_array, and these entries must
     be the first elements of s_f_array.
     */
-    cInstEntryCPU("nop-A",     &cHardwareCPU::Inst_Nop),
-    cInstEntryCPU("nop-B",     &cHardwareCPU::Inst_Nop),
-    cInstEntryCPU("nop-C",     &cHardwareCPU::Inst_Nop),
-
-    // Added "map-null" for use in analyze mode. -- kgn
-    cInstEntryCPU("map-null",     &cHardwareCPU::Inst_Nop),
-    cInstEntryCPU("nop-X",     &cHardwareCPU::Inst_Nop),
-    cInstEntryCPU("if-equ-0",  &cHardwareCPU::Inst_If0),
-    cInstEntryCPU("if-not-0",  &cHardwareCPU::Inst_IfNot0),
-    cInstEntryCPU("if-n-equ",  &cHardwareCPU::Inst_IfNEqu),
-    cInstEntryCPU("if-equ",    &cHardwareCPU::Inst_IfEqu),
+    cInstEntryCPU("nop-A",     &cHardwareCPU::Inst_Nop, true,
+		  "No-operation instruction; modifies other instructions"),
+    cInstEntryCPU("nop-B",     &cHardwareCPU::Inst_Nop, true,
+		  "No-operation instruction; modifies other instructions"),
+    cInstEntryCPU("nop-C",     &cHardwareCPU::Inst_Nop, true,
+		  "No-operation instruction; modifies other instructions"),
+
+    cInstEntryCPU("NULL",      &cHardwareCPU::Inst_Nop, false,
+		  "True no-operation instruction: does nothing"),
+    cInstEntryCPU("nop-X",     &cHardwareCPU::Inst_Nop, false,
+		  "True no-operation instruction: does nothing"),
+    cInstEntryCPU("if-equ-0",  &cHardwareCPU::Inst_If0, false,
+		  "Execute next instruction if ?BX?==0, else skip it"),
+    cInstEntryCPU("if-not-0",  &cHardwareCPU::Inst_IfNot0, false,
+		  "Execute next instruction if ?BX?!=0, else skip it"),
+    cInstEntryCPU("if-n-equ",  &cHardwareCPU::Inst_IfNEqu, true,
+		  "Execute next instruction if ?BX?!=?CX?, else skip it"),
+    cInstEntryCPU("if-equ",    &cHardwareCPU::Inst_IfEqu, false,
+		  "Execute next instruction if ?BX?==?CX?, else skip it"),
     cInstEntryCPU("if-grt-0",  &cHardwareCPU::Inst_IfGr0),
     cInstEntryCPU("if-grt",    &cHardwareCPU::Inst_IfGr),
     cInstEntryCPU("if->=-0",   &cHardwareCPU::Inst_IfGrEqu0),
     cInstEntryCPU("if->=",     &cHardwareCPU::Inst_IfGrEqu),
     cInstEntryCPU("if-les-0",  &cHardwareCPU::Inst_IfLess0),
-    cInstEntryCPU("if-less",   &cHardwareCPU::Inst_IfLess),
+    cInstEntryCPU("if-less",   &cHardwareCPU::Inst_IfLess, true,
+		  "Execute next instruction if ?BX? < ?CX?, else skip it"),
     cInstEntryCPU("if-<=-0",   &cHardwareCPU::Inst_IfLsEqu0),
     cInstEntryCPU("if-<=",     &cHardwareCPU::Inst_IfLsEqu),
     cInstEntryCPU("if-A!=B",   &cHardwareCPU::Inst_IfANotEqB),
     cInstEntryCPU("if-B!=C",   &cHardwareCPU::Inst_IfBNotEqC),
     cInstEntryCPU("if-A!=C",   &cHardwareCPU::Inst_IfANotEqC),
-    
     cInstEntryCPU("if-bit-1",  &cHardwareCPU::Inst_IfBit1),
+
     cInstEntryCPU("jump-f",    &cHardwareCPU::Inst_JumpF),
     cInstEntryCPU("jump-b",    &cHardwareCPU::Inst_JumpB),
     cInstEntryCPU("jump-p",    &cHardwareCPU::Inst_JumpP),
@@ -293,11 +308,15 @@
     cInstEntryCPU("call",      &cHardwareCPU::Inst_Call),
     cInstEntryCPU("return",    &cHardwareCPU::Inst_Return),
 
-    cInstEntryCPU("pop",       &cHardwareCPU::Inst_Pop),
-    cInstEntryCPU("push",      &cHardwareCPU::Inst_Push),
-    cInstEntryCPU("swap-stk",  &cHardwareCPU::Inst_SwitchStack),
+    cInstEntryCPU("pop",       &cHardwareCPU::Inst_Pop, true,
+		  "Remove top number from stack and place into ?BX?"),
+    cInstEntryCPU("push",      &cHardwareCPU::Inst_Push, true,
+		  "Copy number from ?BX? and place it into the stack"),
+    cInstEntryCPU("swap-stk",  &cHardwareCPU::Inst_SwitchStack, true,
+		  "Toggle which stack is currently being used"),
     cInstEntryCPU("flip-stk",  &cHardwareCPU::Inst_FlipStack),
-    cInstEntryCPU("swap",      &cHardwareCPU::Inst_Swap),
+    cInstEntryCPU("swap",      &cHardwareCPU::Inst_Swap, true,
+		  "Swap the contents of ?BX? with ?CX?"),
     cInstEntryCPU("swap-AB",   &cHardwareCPU::Inst_SwapAB),
     cInstEntryCPU("swap-BC",   &cHardwareCPU::Inst_SwapBC),
     cInstEntryCPU("swap-AC",   &cHardwareCPU::Inst_SwapAC),
@@ -317,25 +336,35 @@
     cInstEntryCPU("push-B",    &cHardwareCPU::Inst_PushB),
     cInstEntryCPU("push-C",    &cHardwareCPU::Inst_PushC),
 
-    cInstEntryCPU("shift-r",   &cHardwareCPU::Inst_ShiftR),
-    cInstEntryCPU("shift-l",   &cHardwareCPU::Inst_ShiftL),
+    cInstEntryCPU("shift-r",   &cHardwareCPU::Inst_ShiftR, true,
+		  "Shift bits in ?BX? right by one (divide by two)"),
+    cInstEntryCPU("shift-l",   &cHardwareCPU::Inst_ShiftL, true,
+		  "Shift bits in ?BX? left by one (multiply by two)"),
     cInstEntryCPU("bit-1",     &cHardwareCPU::Inst_Bit1),
     cInstEntryCPU("set-num",   &cHardwareCPU::Inst_SetNum),
-    cInstEntryCPU("inc",       &cHardwareCPU::Inst_Inc),
-    cInstEntryCPU("dec",       &cHardwareCPU::Inst_Dec),
-    cInstEntryCPU("zero",      &cHardwareCPU::Inst_Zero),
+    cInstEntryCPU("inc",       &cHardwareCPU::Inst_Inc, true,
+		  "Increment ?BX? by one"),
+    cInstEntryCPU("dec",       &cHardwareCPU::Inst_Dec, true,
+		  "Decrement ?BX? by one"),
+    cInstEntryCPU("zero",      &cHardwareCPU::Inst_Zero, false,
+		  "Set ?BX? to zero"),
     cInstEntryCPU("neg",       &cHardwareCPU::Inst_Neg),
     cInstEntryCPU("square",    &cHardwareCPU::Inst_Square),
     cInstEntryCPU("sqrt",      &cHardwareCPU::Inst_Sqrt),
     cInstEntryCPU("not",       &cHardwareCPU::Inst_Not),
     cInstEntryCPU("minus-17",  &cHardwareCPU::Inst_Minus17),
     
-    cInstEntryCPU("add",       &cHardwareCPU::Inst_Add),
-    cInstEntryCPU("sub",       &cHardwareCPU::Inst_Sub),
-    cInstEntryCPU("mult",      &cHardwareCPU::Inst_Mult),
-    cInstEntryCPU("div",       &cHardwareCPU::Inst_Div),
+    cInstEntryCPU("add",       &cHardwareCPU::Inst_Add, true,
+		  "Add BX to CX and place the result in ?BX?"),
+    cInstEntryCPU("sub",       &cHardwareCPU::Inst_Sub, true,
+		  "Subtract CX from BX and place the result in ?BX?"),
+    cInstEntryCPU("mult",      &cHardwareCPU::Inst_Mult, false,
+		  "Multiple BX by CX and place the result in ?BX?"),
+    cInstEntryCPU("div",       &cHardwareCPU::Inst_Div, false,
+		  "Divide BX by CX and place the result in ?BX?"),
     cInstEntryCPU("mod",       &cHardwareCPU::Inst_Mod),
-    cInstEntryCPU("nand",      &cHardwareCPU::Inst_Nand),
+    cInstEntryCPU("nand",      &cHardwareCPU::Inst_Nand, true,
+		  "Nand BX by CX and place the result in ?BX?"),
     cInstEntryCPU("nor",       &cHardwareCPU::Inst_Nor),
     cInstEntryCPU("and",       &cHardwareCPU::Inst_And),
     cInstEntryCPU("order",     &cHardwareCPU::Inst_Order),
@@ -359,7 +388,8 @@
     cInstEntryCPU("stk-get",   &cHardwareCPU::Inst_TaskStackGet),
     cInstEntryCPU("stk-load",  &cHardwareCPU::Inst_TaskStackLoad),
     cInstEntryCPU("put",       &cHardwareCPU::Inst_TaskPut),
-    cInstEntryCPU("IO",        &cHardwareCPU::Inst_TaskIO),
+    cInstEntryCPU("IO",        &cHardwareCPU::Inst_TaskIO, true,
+		  "Output ?BX?, and input new number back into ?BX?"),
     cInstEntryCPU("search-f",  &cHardwareCPU::Inst_SearchF),
     cInstEntryCPU("search-b",  &cHardwareCPU::Inst_SearchB),
     cInstEntryCPU("mem-size",  &cHardwareCPU::Inst_MemSize),
@@ -376,21 +406,30 @@
     cInstEntryCPU("id-th",     &cHardwareCPU::Inst_ThreadID),
 
     // Head-based instructions
-    cInstEntryCPU("h-alloc",   &cHardwareCPU::Inst_MaxAlloc),
-    cInstEntryCPU("h-divide",  &cHardwareCPU::Inst_HeadDivide),
+    cInstEntryCPU("h-alloc",   &cHardwareCPU::Inst_MaxAlloc, true,
+		  "Allocate maximum allowed space"),
+    cInstEntryCPU("h-divide",  &cHardwareCPU::Inst_HeadDivide, true,
+		  "Divide code between read and write heads."),
     cInstEntryCPU("h-read",    &cHardwareCPU::Inst_HeadRead),
     cInstEntryCPU("h-write",   &cHardwareCPU::Inst_HeadWrite),
-    cInstEntryCPU("h-copy",    &cHardwareCPU::Inst_HeadCopy),
-    cInstEntryCPU("h-search",  &cHardwareCPU::Inst_HeadSearch),
+    cInstEntryCPU("h-copy",    &cHardwareCPU::Inst_HeadCopy, true,
+		  "Copy from read-head to write-head; advance both"),
+    cInstEntryCPU("h-search",  &cHardwareCPU::Inst_HeadSearch, true,
+		  "Find complement template and make with flow head"),
     cInstEntryCPU("h-push",    &cHardwareCPU::Inst_HeadPush),
     cInstEntryCPU("h-pop",     &cHardwareCPU::Inst_HeadPop),
     cInstEntryCPU("set-head",  &cHardwareCPU::Inst_SetHead),
     cInstEntryCPU("adv-head",  &cHardwareCPU::Inst_AdvanceHead),
-    cInstEntryCPU("mov-head",  &cHardwareCPU::Inst_MoveHead),
-    cInstEntryCPU("jmp-head",  &cHardwareCPU::Inst_JumpHead),
-    cInstEntryCPU("get-head",  &cHardwareCPU::Inst_GetHead),
-    cInstEntryCPU("if-label",  &cHardwareCPU::Inst_IfLabel),
-    cInstEntryCPU("set-flow",  &cHardwareCPU::Inst_SetFlow),
+    cInstEntryCPU("mov-head",  &cHardwareCPU::Inst_MoveHead, true,
+		  "Move head ?IP? to the flow head"),
+    cInstEntryCPU("jmp-head",  &cHardwareCPU::Inst_JumpHead, true,
+		  "Move head ?IP? by amount in CX register; CX = old pos."),
+    cInstEntryCPU("get-head",  &cHardwareCPU::Inst_GetHead, true,
+		  "Copy the position of the ?IP? head into CX"),
+    cInstEntryCPU("if-label",  &cHardwareCPU::Inst_IfLabel, true,
+		  "Execute next if we copied complement of attached label"),
+    cInstEntryCPU("set-flow",  &cHardwareCPU::Inst_SetFlow, true,
+		  "Set flow-head to position in ?CX?"),
 
     cInstEntryCPU("h-copy2",    &cHardwareCPU::Inst_HeadCopy2),
     cInstEntryCPU("h-copy3",    &cHardwareCPU::Inst_HeadCopy3),
@@ -2217,8 +2256,8 @@
 bool cHardwareCPU::Inst_PopC() { Register(REG_CX) = StackPop(); return true;}
 
 bool cHardwareCPU::Inst_PushA() { StackPush(Register(REG_AX)); return true;}
-bool cHardwareCPU::Inst_PushB() { StackPush(Register(REG_AX)); return true;}
-bool cHardwareCPU::Inst_PushC() { StackPush(Register(REG_AX)); return true;}
+bool cHardwareCPU::Inst_PushB() { StackPush(Register(REG_BX)); return true;}
+bool cHardwareCPU::Inst_PushC() { StackPush(Register(REG_CX)); return true;}
 
 bool cHardwareCPU::Inst_SwitchStack() { SwitchStack(); return true;}
 bool cHardwareCPU::Inst_FlipStack()   { StackFlip(); return true;}
Index: avida/current/source/cpu/hardware_cpu.hh
diff -u avida/current/source/cpu/hardware_cpu.hh:1.28 avida/current/source/cpu/hardware_cpu.hh:1.29
--- avida/current/source/cpu/hardware_cpu.hh:1.28	Sun May 18 21:15:22 2003
+++ avida/current/source/cpu/hardware_cpu.hh	Sun May 25 09:46:30 2003
@@ -107,6 +107,8 @@
   ~cHardwareCPU();
   void Recycle(cOrganism * new_organism, cInstSet * in_inst_set);
   static cInstLibBase *GetInstLib();
+  static cString GetDefaultInstFilename() { return "inst_lib.default"; }
+  static void WriteDefaultInstSet() { ; }
 
   void Reset();
   void SingleProcess(std::ostream * trace_fp=NULL);
Index: avida/current/source/cpu/hardware_util.cc
diff -u avida/current/source/cpu/hardware_util.cc:1.25 avida/current/source/cpu/hardware_util.cc:1.26
--- avida/current/source/cpu/hardware_util.cc:1.25	Fri May 23 04:43:22 2003
+++ avida/current/source/cpu/hardware_util.cc	Sun May 25 09:46:30 2003
@@ -23,17 +23,54 @@
 
 
 #ifdef USE_INST_SET_CODE
-void cHardwareUtil::LoadInstSet(const cString & filename, cInstSet & inst_set, 
+void cHardwareUtil::LoadInstSet(cString filename, cInstSet & inst_set, 
 				tDictionary<int> & nop_dict,
 				tDictionary<int> & inst_dict
 ){
 #else /* USE_INST_SET_CODE */
-void cHardwareUtil::LoadInstSet(const cString & filename, cInstSet & inst_set, 
+void cHardwareUtil::LoadInstSet(cString & filename, cInstSet & inst_set, 
 				tDictionary<int> & nop_dict,
 				tDictionary<tHardwareMethod> & inst_dict
 ){
 #endif /* USE_INST_SET_CODE */
+  // If there is no filename, use the default for the appropriate hardware.
+  cString default_filename = "unknown";
+  if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+    default_filename = cHardwareCPU::GetDefaultInstFilename();
+  }
+  else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+    default_filename = cHardware4Stack::GetDefaultInstFilename();
+  }
+
+  if (filename == "") {
+    cerr << "Warning: No instruction set specified; using default '"
+	 << filename << "'." << endl;
+    filename = default_filename;
+  }
+
   cInitFile file(filename);
+
+  // If we could not open the instruction set what to do?
+  if (file.IsOpen() == false) {
+
+    // If this is the default filename, write the file and try again.
+    if (filename == default_filename) {
+      if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+	cHardwareCPU::WriteDefaultInstSet();
+      }
+      else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+	cHardware4Stack::WriteDefaultInstSet();
+      }      
+    }
+
+    // If this is not the default filename, give and error and stop.
+    else {
+      cerr << "Error: Could not file instruction set '" << filename
+	   << "'.  Halting." << endl;
+      exit(1);
+    }
+  }
+
   file.Load();
   file.Compress();
 
Index: avida/current/source/cpu/hardware_util.hh
diff -u avida/current/source/cpu/hardware_util.hh:1.7 avida/current/source/cpu/hardware_util.hh:1.8
--- avida/current/source/cpu/hardware_util.hh:1.7	Fri May 23 04:43:22 2003
+++ avida/current/source/cpu/hardware_util.hh	Sun May 25 09:46:30 2003
@@ -20,19 +20,11 @@
 class cHardwareUtil {
 public:
 #ifdef USE_INST_SET_CODE
-  static void LoadInstSet(
-    const cString & filename,
-    cInstSet & inst_set, 
-		tDictionary<int> & nop_dict,
-		tDictionary<int> & inst_dict
-  );
+  static void LoadInstSet( cString filename, cInstSet & inst_set, 
+	tDictionary<int> & nop_dict, tDictionary<int> & inst_dict );
 #else /* USE_INST_SET_CODE */
-  static void LoadInstSet(
-    const cString & filename,
-    cInstSet & inst_set, 
-		tDictionary<int> & nop_dict,
-		tDictionary<tHardwareMethod> & inst_dict
-  );
+  static void LoadInstSet( cString filename, cInstSet & inst_set, 
+	tDictionary<int> & nop_dict, tDictionary<tHardwareMethod> & inst_dict);
 #endif /* USE_INST_SET_CODE */
   static void LoadInstSet_CPUOriginal(const cString & filename,
 				      cInstSet & inst_set);
Index: avida/current/source/main/analyze.cc
diff -u avida/current/source/main/analyze.cc:1.71 avida/current/source/main/analyze.cc:1.72
--- avida/current/source/main/analyze.cc:1.71	Fri May 23 04:43:22 2003
+++ avida/current/source/main/analyze.cc	Sun May 25 09:46:31 2003
@@ -1808,13 +1808,13 @@
     cInstSet map_inst_set(inst_set);
 #ifdef USE_INST_SET_CODE
     /* XXX start -- kgn */
-    // Locate instruction corresponding to "map-null" in the instruction library.
+    // Locate instruction corresponding to "NULL" in the instruction library.
     {
-      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("map-null");
+      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("NULL");
       if(inst_lib_null_inst == map_inst_set.GetInstLib()->GetInstError()){
         cout << "<cAnalyze::CommandMapTasks> got error:" << endl;
-        cout << " --- instruction \"map-null\" isn't in the instruction library;" << endl;
-        cout << " --- get somebody to map a function to \"map-null\" in the library." << endl;
+        cout << " --- instruction \"NULL\" isn't in the instruction library;" << endl;
+        cout << " --- get somebody to map a function to \"NULL\" in the library." << endl;
         cout << " --- (probably to class method \"cHardware-of-some-type::initInstLib\"" << endl;
         cout << " --- in file named \"cpu/hardware-of-some-type.cc\".)" << endl;
         cout << " --- bailing-out." << endl;
@@ -1823,12 +1823,12 @@
       // Add mapping to located instruction. 
       map_inst_set.Add2(inst_lib_null_inst.GetOp());
     }
-    const cInstruction null_inst = map_inst_set.GetInst("map-null");
+    const cInstruction null_inst = map_inst_set.GetInst("NULL");
     /* XXX end */
 #else /* USE_INST_SET_CODE */
     // Build an empty instruction into the instruction set.
-    map_inst_set.Add("map-null", &cHardwareBase::Inst_Nop);
-    const cInstruction null_inst = map_inst_set.GetInst("map-null");
+    map_inst_set.Add("NULL", &cHardwareBase::Inst_Nop);
+    const cInstruction null_inst = map_inst_set.GetInst("NULL");
 #endif /* USE_INST_SET_CODE */
 
     // Loop through all the lines of code, testing the removal of each.
@@ -2018,13 +2018,13 @@
     cInstSet map_inst_set(inst_set);
 #ifdef USE_INST_SET_CODE
     /* XXX start -- kgn */
-    // Locate instruction corresponding to "map-null" in the instruction library.
+    // Locate instruction corresponding to "NULL" in the instruction library.
     {
-      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("map-null");
+      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("NULL");
       if(inst_lib_null_inst == map_inst_set.GetInstLib()->GetInstError()){
         cout << "<cAnalyze::CommandMapMutations> got error:" << endl;
-        cout << " --- instruction \"map-null\" isn't in the instruction library;" << endl;
-        cout << " --- get somebody to map a function to \"map-null\" in the library." << endl;
+        cout << " --- instruction \"NULL\" isn't in the instruction library;" << endl;
+        cout << " --- get somebody to map a function to \"NULL\" in the library." << endl;
         cout << " --- (probably to class method \"cHardware-of-some-type::initInstLib\"" << endl;
         cout << " --- in file named \"cpu/hardware-of-some-type.cc\".)" << endl;
         cout << " --- bailing-out." << endl;
@@ -2033,12 +2033,12 @@
       // Add mapping to located instruction. 
       map_inst_set.Add2(inst_lib_null_inst.GetOp());
     }
-    const cInstruction null_inst = map_inst_set.GetInst("map-null");
+    const cInstruction null_inst = map_inst_set.GetInst("NULL");
     /* XXX end */
 #else /* USE_INST_SET_CODE */
     // Build an empty instruction into the instruction set.
-    map_inst_set.Add("map-null", &cHardwareBase::Inst_Nop);
-    const cInstruction null_inst = map_inst_set.GetInst("map-null");
+    map_inst_set.Add("NULL", &cHardwareBase::Inst_Nop);
+    const cInstruction null_inst = map_inst_set.GetInst("NULL");
 #endif /* USE_INST_SET_CODE */
 
     cString color_string;  // For coloring cells...
Index: avida/current/source/main/config.cc
diff -u avida/current/source/main/config.cc:1.55 avida/current/source/main/config.cc:1.56
--- avida/current/source/main/config.cc:1.55	Tue May 20 07:42:28 2003
+++ avida/current/source/main/config.cc	Sun May 25 09:46:31 2003
@@ -122,7 +122,7 @@
   if (dir_tail != '\\' && dir_tail != '/') default_dir += "/";
 
   // Input files...
-  inst_filename  = genesis.ReadString("INST_SET", "inst_set");
+  inst_filename  = genesis.ReadString("INST_SET");
   event_filename = genesis.ReadString("EVENT_FILE", "events.cfg");
   analyze_filename = genesis.ReadString("ANALYZE_FILE", "analyze.cfg");
   env_filename = genesis.ReadString("ENVIRONMENT_FILE", "environment.cfg");


More information about the Avida-cvs mailing list