[avida-cvs] avida(Sherri) CVS commits: /current Makefile.am README /current/doc Makefile.am /current/doc/glossary Makefile.am /current/source Makefile.am defs.hh modules.pri /current/source/cpu Makefile.am hardware_4stack.cc hardware_cpu.cc hardware_factory.cc hardware_util.cc hardware_util.hh /current/source/event Makefile.am /current/source/main Makefile.am analyze.cc avida.cc callback_util.cc inst_set.cc inst_set.hh /current/source/qt-viewer Makefile.am setup_avida.cc /current/source/qt-viewer/exp/share Makefile.am /current/source/support Makefile.am /current/source/support/preset_organisms Makefile.am /current/source/third-party Makefile.am /current/source/third-party/trio-1.9 Makefile.am /current/source/tools Makefile.am /current/source/viewers Makefile.am

goingssh avida-cvs at alife.org
Fri May 23 20:05:41 PDT 2003


goingssh		Fri May 23 12:05:41 2003 EDT

  Modified files:              (Branch: Sherri)
    /avida/current	Makefile.am README 
    /avida/current/doc	Makefile.am 
    /avida/current/doc/glossary	Makefile.am 
    /avida/current/source	Makefile.am defs.hh modules.pri 
    /avida/current/source/cpu	Makefile.am hardware_4stack.cc 
                             	hardware_cpu.cc hardware_factory.cc 
                             	hardware_util.cc hardware_util.hh 
    /avida/current/source/event	Makefile.am 
    /avida/current/source/main	Makefile.am analyze.cc avida.cc 
                              	callback_util.cc inst_set.cc inst_set.hh 
    /avida/current/source/qt-viewer	Makefile.am setup_avida.cc 
    /avida/current/source/qt-viewer/exp/share	Makefile.am 
    /avida/current/source/support	Makefile.am 
    /avida/current/source/support/preset_organisms	Makefile.am 
    /avida/current/source/third-party	Makefile.am 
    /avida/current/source/third-party/trio-1.9	Makefile.am 
    /avida/current/source/tools	Makefile.am 
    /avida/current/source/viewers	Makefile.am 
  Log:
  Commiting merge of main branch and my branch to my branch
  
-------------- next part --------------
Index: avida/current/Makefile.am
diff -u avida/current/Makefile.am:1.7 avida/current/Makefile.am:1.7.4.1
--- avida/current/Makefile.am:1.7	Thu Mar 13 14:24:56 2003
+++ avida/current/Makefile.am	Fri May 23 12:05:34 2003
@@ -1,3 +1,4 @@
+
 #CXXFLAGS   = -Wall
 #MAKEFLAGS = -j2 -e CXXFLAGS -e VIEW_LIBS
 #VIEW_LIBS = @VIEW_LIBS@
Index: avida/current/README
diff -u avida/current/README:1.2 avida/current/README:1.2.6.1
--- avida/current/README:1.2	Fri Oct 27 15:05:37 2000
+++ avida/current/README	Fri May 23 12:05:35 2003
@@ -1,3 +1,4 @@
+
 To compile and install Avida, you have to do
   ./configure; make; make install
 
@@ -5,7 +6,7 @@
 viewer. The installation goes into a directory called 'work' that 
 is created in your working directory. See below how to change that.
 
-There is a number of options you can give to configure to change the
+There are a number of options you can give to configure to change the
 default behavior:
   --enable-debug: Compile with debugging symbols instead of optimized.
   --enable-gnu-debug: Compile with special debugging symbols for the
@@ -37,7 +38,7 @@
 instead of 'make install'.
 
 *Important*:
-If you have already build Avida without viewer, and you want to
+If you have already built Avida without viewer, and you want to
 rebuild it with viewer, or vice versa, you have to issue a
   make viewer-clean
 between the two builds. Otherwise, strange things might happen.
Index: avida/current/doc/Makefile.am
diff -u avida/current/doc/Makefile.am:1.2 avida/current/doc/Makefile.am:1.2.2.1
--- avida/current/doc/Makefile.am:1.2	Mon May 12 09:15:33 2003
+++ avida/current/doc/Makefile.am	Fri May 23 12:05:35 2003
@@ -1,3 +1,4 @@
+
 SUBDIRS = glossary
 
 htmldir = $(HTMLDIR)
Index: avida/current/doc/glossary/Makefile.am
diff -u avida/current/doc/glossary/Makefile.am:1.1 avida/current/doc/glossary/Makefile.am:1.1.4.1
--- avida/current/doc/glossary/Makefile.am:1.1	Mon May 12 09:15:33 2003
+++ avida/current/doc/glossary/Makefile.am	Fri May 23 12:05:35 2003
@@ -1,3 +1,4 @@
+
 glossaryhtmldir = $(HTMLDIR)/glossary
 glossaryhtml_DATA = \
   components.help \
Index: avida/current/source/Makefile.am
diff -u avida/current/source/Makefile.am:1.23 avida/current/source/Makefile.am:1.23.2.1
--- avida/current/source/Makefile.am:1.23	Sat May 17 02:48:07 2003
+++ avida/current/source/Makefile.am	Fri May 23 12:05:36 2003
@@ -1,4 +1,5 @@
 
+
 SUBDIRS_PRIMITIVE = support
 if BUILD_PRIMITIVE
 SUBDIRS_PRIMITIVE += third-party tools cpu event main
Index: avida/current/source/defs.hh
diff -u avida/current/source/defs.hh:1.27 avida/current/source/defs.hh:1.27.2.1
--- avida/current/source/defs.hh:1.27	Sun May 18 21:15:21 2003
+++ avida/current/source/defs.hh	Fri May 23 12:05:36 2003
@@ -18,6 +18,15 @@
 #define HTMLDIR "../work/doc_html/"
 #endif
 
+/*
+When defined, instruction sets, instruction libraries, hardware use new
+instruction set code.  The old code remains, and will be used if the
+following is not defined.
+*/
+/* XXX remove after regression tests */
+#define USE_INST_SET_CODE
+/**/
+
 // -= Various view modes =-
 #define VIEW_NEWVIEWER
 // #define VIEW_VISTA
Index: avida/current/source/modules.pri
diff -u avida/current/source/modules.pri:1.2 avida/current/source/modules.pri:1.2.2.1
--- avida/current/source/modules.pri:1.2	Sat May 17 02:48:07 2003
+++ avida/current/source/modules.pri	Fri May 23 12:05:36 2003
@@ -4,12 +4,16 @@
 MAIN_CC   = $$AVIDA_SRC_DIR/main
 TRIO_C    = $$AVIDA_SRC_DIR/third-party/trio-1.9
 TOOLS_CC  = $$AVIDA_SRC_DIR/tools
+SUPPORT_CC= $$AVIDA_SRC_DIR/support
+DOC_CC	  = $$AVIDA_SRC_DIR/../doc
 
 CPU_HH    = $$CPU_CC
 EVENT_HH  = $$EVENT_CC
 MAIN_HH   = $$MAIN_CC
 TRIO_H    = $$TRIO_C
 TOOLS_HH  = $$TOOLS_CC
+SUPPORT_HH= $$SUPPORT_CC
+DOC_HH 	  = $$DOC_CC
 
 DEPENDPATH += ;$$AVIDA_SRC_DIR
 DEPENDPATH += ;$$CPU_HH
@@ -17,6 +21,8 @@
 DEPENDPATH += ;$$MAIN_HH
 DEPENDPATH += ;$$TRIO_H
 DEPENDPATH += ;$$TOOLS_HH
+DEPENDPATH += ;$$SUPPORT_HH
+DEPENDPATH += ;$$DOC_HH
 
 INCLUDEPATH += $$DEPENDPATH
 
@@ -25,3 +31,5 @@
 include($$MAIN_CC/main_sub.pri)
 include($$TRIO_C/trio.pri)
 include($$TOOLS_CC/tools.pri)
+include($$SUPPORT_CC/support.pri)
+include($$DOC_CC/doc.pri)
Index: avida/current/source/cpu/Makefile.am
diff -u avida/current/source/cpu/Makefile.am:1.17 avida/current/source/cpu/Makefile.am:1.17.2.1
--- avida/current/source/cpu/Makefile.am:1.17	Mon May 19 13:35:49 2003
+++ avida/current/source/cpu/Makefile.am	Fri May 23 12:05:36 2003
@@ -1,3 +1,4 @@
+
 libcpu_a_SOURCES = \
   cpu_memory.cc cpu_memory.hh \
   cpu_stack.cc cpu_stack.hh \
Index: avida/current/source/cpu/hardware_4stack.cc
diff -u avida/current/source/cpu/hardware_4stack.cc:1.2 avida/current/source/cpu/hardware_4stack.cc:1.2.4.1
--- avida/current/source/cpu/hardware_4stack.cc:1.2	Mon May 19 12:30:06 2003
+++ avida/current/source/cpu/hardware_4stack.cc	Fri May 23 12:05:36 2003
@@ -145,12 +145,18 @@
 
   char marker; fp>>marker; assert( marker == '|' );
   /* YIKES!  data loss below: */
+#ifdef USE_INST_SET_CODE
   char the_cur_stack = cur_stack;
   char the_cur_head = cur_head;
   char the_input_pointer = input_pointer;
   fp.get(the_cur_stack);
   fp.get(the_cur_head);
   fp.get(the_input_pointer);
+#else /* USE_INST_SET_CODE */
+  fp.get((char)cur_stack);
+  fp.get((char)cur_head);
+  fp.get((char)input_pointer);
+#endif /* USE_INST_SET_CODE */
 
   // IO buffers
   input_buf.LoadState(fp);
@@ -162,6 +168,7 @@
 }
 
 
+#ifdef USE_INST_SET_CODE
 ///////////////
 //  cInstLib4Stack
 ///////////////
@@ -217,12 +224,13 @@
   const cInstruction & GetInstDefault(){ return inst_default; }
   const cInstruction & GetInstError(){ return inst_error; }
 };
-
+#endif /* USE_INST_SET_CODE */
 
 ///////////////
 //  cHardware4Stack
 ///////////////
 
+#ifdef USE_INST_SET_CODE
 const cInstruction cInstLib4Stack::inst_error(255);
 const cInstruction cInstLib4Stack::inst_default(0);
 cInstLibBase *cHardware4Stack::GetInstLib(){ return s_inst_slib; }
@@ -246,25 +254,22 @@
     tHardware4StackMethod function;
   };
   static const cInstEntry4Stack s_f_array[] = {
+    /*
+    Note: all entries of cNOPEntryCPU s_n_array must have corresponding
+    in the same order in cInstEntryCPU s_f_array, and these entries must
+    be the first elements of s_f_array.
+    */
     cInstEntry4Stack("nop-A",     &cHardware4Stack::Inst_Nop),
     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("nop-X",     &cHardware4Stack::Inst_Nop),
     cInstEntry4Stack("if-equ-0",  &cHardware4Stack::Inst_If0),
     cInstEntry4Stack("if-not-0",  &cHardware4Stack::Inst_IfNot0),
     cInstEntry4Stack("if-n-equ",  &cHardware4Stack::Inst_IfNEqu),
     cInstEntry4Stack("if-equ",    &cHardware4Stack::Inst_IfEqu),
-    cInstEntry4Stack("if-grt-0",  &cHardware4Stack::Inst_IfGr0),
-    cInstEntry4Stack("if-grt",    &cHardware4Stack::Inst_IfGr),
-    cInstEntry4Stack("if->=-0",   &cHardware4Stack::Inst_IfGrEqu0),
-    cInstEntry4Stack("if->=",     &cHardware4Stack::Inst_IfGrEqu),
-    cInstEntry4Stack("if-les-0",  &cHardware4Stack::Inst_IfLess0),
-    cInstEntry4Stack("if-less",   &cHardware4Stack::Inst_IfLess),
-    cInstEntry4Stack("if-<=-0",   &cHardware4Stack::Inst_IfLsEqu0),
-    cInstEntry4Stack("if-<=",     &cHardware4Stack::Inst_IfLsEqu),
-    cInstEntry4Stack("if-A!=B",   &cHardware4Stack::Inst_IfANotEqB),
-    cInstEntry4Stack("if-B!=C",   &cHardware4Stack::Inst_IfBNotEqC),
-    cInstEntry4Stack("if-A!=C",   &cHardware4Stack::Inst_IfANotEqC),
     
     cInstEntry4Stack("if-bit-1",  &cHardware4Stack::Inst_IfBit1),
     cInstEntry4Stack("jump-f",    &cHardware4Stack::Inst_JumpF),
@@ -277,26 +282,8 @@
     cInstEntry4Stack("pop",       &cHardware4Stack::Inst_Pop),
     cInstEntry4Stack("push",      &cHardware4Stack::Inst_Push),
     cInstEntry4Stack("swap-stk",  &cHardware4Stack::Inst_SwitchStack),
-    cInstEntry4Stack("flip-stk",  &cHardware4Stack::Inst_FlipStack),
     cInstEntry4Stack("swap",      &cHardware4Stack::Inst_Swap),
-    cInstEntry4Stack("swap-AB",   &cHardware4Stack::Inst_SwapAB),
-    cInstEntry4Stack("swap-BC",   &cHardware4Stack::Inst_SwapBC),
-    cInstEntry4Stack("swap-AC",   &cHardware4Stack::Inst_SwapAC),
     cInstEntry4Stack("copy-reg",  &cHardware4Stack::Inst_CopyReg),
-    cInstEntry4Stack("set_A=B",   &cHardware4Stack::Inst_CopyRegAB),
-    cInstEntry4Stack("set_A=C",   &cHardware4Stack::Inst_CopyRegAC),
-    cInstEntry4Stack("set_B=A",   &cHardware4Stack::Inst_CopyRegBA),
-    cInstEntry4Stack("set_B=C",   &cHardware4Stack::Inst_CopyRegBC),
-    cInstEntry4Stack("set_C=A",   &cHardware4Stack::Inst_CopyRegCA),
-    cInstEntry4Stack("set_C=B",   &cHardware4Stack::Inst_CopyRegCB),
-    cInstEntry4Stack("reset",     &cHardware4Stack::Inst_Reset),
-
-    cInstEntry4Stack("pop-A",     &cHardware4Stack::Inst_PopA),
-    cInstEntry4Stack("pop-B",     &cHardware4Stack::Inst_PopB),
-    cInstEntry4Stack("pop-C",     &cHardware4Stack::Inst_PopC),
-    cInstEntry4Stack("push-A",    &cHardware4Stack::Inst_PushA),
-    cInstEntry4Stack("push-B",    &cHardware4Stack::Inst_PushB),
-    cInstEntry4Stack("push-C",    &cHardware4Stack::Inst_PushC),
 
     cInstEntry4Stack("shift-r",   &cHardware4Stack::Inst_ShiftR),
     cInstEntry4Stack("shift-l",   &cHardware4Stack::Inst_ShiftL),
@@ -304,11 +291,6 @@
     cInstEntry4Stack("set-num",   &cHardware4Stack::Inst_SetNum),
     cInstEntry4Stack("inc",       &cHardware4Stack::Inst_Inc),
     cInstEntry4Stack("dec",       &cHardware4Stack::Inst_Dec),
-    cInstEntry4Stack("zero",      &cHardware4Stack::Inst_Zero),
-    cInstEntry4Stack("neg",       &cHardware4Stack::Inst_Neg),
-    cInstEntry4Stack("square",    &cHardware4Stack::Inst_Square),
-    cInstEntry4Stack("sqrt",      &cHardware4Stack::Inst_Sqrt),
-    cInstEntry4Stack("not",       &cHardware4Stack::Inst_Not),
     cInstEntry4Stack("minus-18",  &cHardware4Stack::Inst_Minus18),
     
     cInstEntry4Stack("add",       &cHardware4Stack::Inst_Add),
@@ -318,27 +300,18 @@
     cInstEntry4Stack("mod",       &cHardware4Stack::Inst_Mod),
     cInstEntry4Stack("nand",      &cHardware4Stack::Inst_Nand),
     cInstEntry4Stack("nor",       &cHardware4Stack::Inst_Nor),
-    cInstEntry4Stack("and",       &cHardware4Stack::Inst_And),
-    cInstEntry4Stack("order",     &cHardware4Stack::Inst_Order),
-    cInstEntry4Stack("xor",       &cHardware4Stack::Inst_Xor),
     
     cInstEntry4Stack("copy",      &cHardware4Stack::Inst_Copy),
     cInstEntry4Stack("read",      &cHardware4Stack::Inst_ReadInst),
     cInstEntry4Stack("write",     &cHardware4Stack::Inst_WriteInst),
-    cInstEntry4Stack("stk-read",  &cHardware4Stack::Inst_StackReadInst),
-    cInstEntry4Stack("stk-writ",  &cHardware4Stack::Inst_StackWriteInst),
     
     cInstEntry4Stack("compare",   &cHardware4Stack::Inst_Compare),
     cInstEntry4Stack("if-n-cpy",  &cHardware4Stack::Inst_IfNCpy),
     cInstEntry4Stack("allocate",  &cHardware4Stack::Inst_Allocate),
     cInstEntry4Stack("divide",    &cHardware4Stack::Inst_Divide),
-    cInstEntry4Stack("c-alloc",   &cHardware4Stack::Inst_CAlloc),
-    cInstEntry4Stack("c-divide",  &cHardware4Stack::Inst_CDivide),
     cInstEntry4Stack("inject",    &cHardware4Stack::Inst_Inject),
     cInstEntry4Stack("inject-r",  &cHardware4Stack::Inst_InjectRand),
     cInstEntry4Stack("get",       &cHardware4Stack::Inst_TaskGet),
-    cInstEntry4Stack("stk-get",   &cHardware4Stack::Inst_TaskStackGet),
-    cInstEntry4Stack("stk-load",  &cHardware4Stack::Inst_TaskStackLoad),
     cInstEntry4Stack("put",       &cHardware4Stack::Inst_TaskPut),
     cInstEntry4Stack("IO",        &cHardware4Stack::Inst_TaskIO),
     cInstEntry4Stack("search-f",  &cHardware4Stack::Inst_SearchF),
@@ -373,69 +346,6 @@
     cInstEntry4Stack("if-label",  &cHardware4Stack::Inst_IfLabel),
     cInstEntry4Stack("set-flow",  &cHardware4Stack::Inst_SetFlow),
 
-    cInstEntry4Stack("h-copy2",    &cHardware4Stack::Inst_HeadCopy2),
-    cInstEntry4Stack("h-copy3",    &cHardware4Stack::Inst_HeadCopy3),
-    cInstEntry4Stack("h-copy4",    &cHardware4Stack::Inst_HeadCopy4),
-    cInstEntry4Stack("h-copy5",    &cHardware4Stack::Inst_HeadCopy5),
-    cInstEntry4Stack("h-copy6",    &cHardware4Stack::Inst_HeadCopy6),
-    cInstEntry4Stack("h-copy7",    &cHardware4Stack::Inst_HeadCopy7),
-    cInstEntry4Stack("h-copy8",    &cHardware4Stack::Inst_HeadCopy8),
-    cInstEntry4Stack("h-copy9",    &cHardware4Stack::Inst_HeadCopy9),
-    cInstEntry4Stack("h-copy10",   &cHardware4Stack::Inst_HeadCopy10),
-
-    cInstEntry4Stack("h-divide1",      &cHardware4Stack::Inst_HeadDivide1),
-    cInstEntry4Stack("h-divide2",      &cHardware4Stack::Inst_HeadDivide2),
-    cInstEntry4Stack("h-divide3",      &cHardware4Stack::Inst_HeadDivide3),
-    cInstEntry4Stack("h-divide4",      &cHardware4Stack::Inst_HeadDivide4),
-    cInstEntry4Stack("h-divide5",      &cHardware4Stack::Inst_HeadDivide5),
-    cInstEntry4Stack("h-divide6",      &cHardware4Stack::Inst_HeadDivide6),
-    cInstEntry4Stack("h-divide7",      &cHardware4Stack::Inst_HeadDivide7),
-    cInstEntry4Stack("h-divide8",      &cHardware4Stack::Inst_HeadDivide8),
-    cInstEntry4Stack("h-divide9",      &cHardware4Stack::Inst_HeadDivide9),
-    cInstEntry4Stack("h-divide10",     &cHardware4Stack::Inst_HeadDivide10),
-    cInstEntry4Stack("h-divide16",     &cHardware4Stack::Inst_HeadDivide16),
-    cInstEntry4Stack("h-divide32",     &cHardware4Stack::Inst_HeadDivide32),
-    cInstEntry4Stack("h-divide50",     &cHardware4Stack::Inst_HeadDivide50),
-    cInstEntry4Stack("h-divide100",    &cHardware4Stack::Inst_HeadDivide100),
-    cInstEntry4Stack("h-divide500",    &cHardware4Stack::Inst_HeadDivide500),
-    cInstEntry4Stack("h-divide1000",   &cHardware4Stack::Inst_HeadDivide1000),
-    cInstEntry4Stack("h-divide5000",   &cHardware4Stack::Inst_HeadDivide5000),
-    cInstEntry4Stack("h-divide10000",  &cHardware4Stack::Inst_HeadDivide10000),
-    cInstEntry4Stack("h-divide50000",  &cHardware4Stack::Inst_HeadDivide50000),
-    cInstEntry4Stack("h-divide0.5",    &cHardware4Stack::Inst_HeadDivide0_5),
-    cInstEntry4Stack("h-divide0.1",    &cHardware4Stack::Inst_HeadDivide0_1),
-    cInstEntry4Stack("h-divide0.05",   &cHardware4Stack::Inst_HeadDivide0_05),
-    cInstEntry4Stack("h-divide0.01",   &cHardware4Stack::Inst_HeadDivide0_01),
-    cInstEntry4Stack("h-divide0.001",  &cHardware4Stack::Inst_HeadDivide0_001),
-
-    // High-level instructions
-    cInstEntry4Stack("repro",      &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-A",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-B",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-C",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-D",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-E",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-F",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-G",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-H",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-I",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-J",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-K",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-L",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-M",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-N",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-O",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-P",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-Q",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-R",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-S",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-T",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-U",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-V",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-W",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-X",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-Y",    &cHardware4Stack::Inst_Repro),
-    cInstEntry4Stack("repro-Z",    &cHardware4Stack::Inst_Repro),
 
     // Placebo instructions
     // nop-x (included with nops)
@@ -443,6 +353,9 @@
   };
 
   const int n_size = sizeof(s_n_array)/sizeof(cNOPEntry4Stack);
+
+  cout << "Instruction Library has " << n_size << " instructions." << endl;
+
   static cString n_names[n_size];
   static int nop_mods[n_size];
   for (int i = 0; i < n_size; i++){
@@ -468,7 +381,7 @@
   );
 
   cout <<
-  "<cHardware4Stack::initInstLib> test of ick" <<endl<<
+  "<cHardware4Stack::initInstLib> debug: important post-init values:" <<endl<<
   " --- GetSize(): " << inst_lib->GetSize() <<endl<<
   " --- GetNumNops(): " << inst_lib->GetNumNops() <<endl<<
   " --- GetName(last): " <<
@@ -477,13 +390,16 @@
 
   return inst_lib;
 }
+#endif /* USE_INST_SET_CODE */
 
 cHardware4Stack::cHardware4Stack(cOrganism * in_organism, cInstSet * in_inst_set)
   : cHardwareBase(in_organism, in_inst_set)
 {
+#ifdef USE_INST_SET_CODE
   /* FIXME:  reorganize storage of m_functions.  -- kgn */
   m_functions = s_inst_slib->GetFunctions();
   /**/
+#endif /* USE_INST_SET_CODE */
   memory = in_organism->GetGenome();  // Initialize memory...
   Reset();                            // Setup the rest of the hardware...
 }
@@ -623,18 +539,25 @@
 bool cHardware4Stack::SingleProcess_ExecuteInst(const cInstruction & cur_inst) 
 {
   // Get a pointer to the corrisponding method...
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  //tHardwareMethod inst_ptr = GetInstSet().GetFunction(cur_inst);
   int inst_idx = GetInstSet().GetLibFunctionIndex(cur_inst);
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+  tHardwareMethod inst_ptr = GetInstSet().GetFunction(cur_inst);
+#endif /* USE_INST_SET_CODE */
       
   // Mark the instruction as executed
   IP().FlagExecuted() = true;
 	
 #ifdef EXECUTION_ERRORS
   // If there is an execution error, execute a random instruction.
+#ifdef USE_INST_SET_CODE
+  if (organism->TestExeErr()) inst_idx = GetInstSet().GetRandFunctionIndex();
+#else /* USE_INST_SET_CODE */
   if (organism->TestExeErr()) inst_ptr = GetInstSet().GetRandFunction();
-#endif
+#endif /* USE_INST_SET_CODE */
+#endif /* EXECUTION_ERRORS */
 	
 #ifdef INSTRUCTION_COUNT
   // instruction execution count incremeneted
@@ -642,12 +565,15 @@
 #endif
 	
   // And execute it.
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  //const bool exec_success = (this->*inst_ptr)();
   const bool exec_success
   //= (this->*(s_inst_slib->GetFunctions()[inst_idx]))();
   = (this->*(m_functions[inst_idx]))();
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+  const bool exec_success = (this->*inst_ptr)();
+#endif /* USE_INST_SET_CODE */
 	
 #ifdef INSTRUCTION_COUNT
   // decremenet if the instruction was not executed successfully
Index: avida/current/source/cpu/hardware_cpu.cc
diff -u avida/current/source/cpu/hardware_cpu.cc:1.45 avida/current/source/cpu/hardware_cpu.cc:1.45.2.1
--- avida/current/source/cpu/hardware_cpu.cc:1.45	Tue May 20 05:07:54 2003
+++ avida/current/source/cpu/hardware_cpu.cc	Fri May 23 12:05:36 2003
@@ -13,9 +13,10 @@
 #include "../tools/string_util.hh"
 
 #include "../main/config.hh"
-#include "../main/inst_set.hh"
+#ifdef USE_INST_SET_CODE
+  #include "../main/inst_set.hh"
+#endif /* USE_INST_SET_CODE */
 #include "../main/inst_lib.hh"
-#include "../main/inst_superlib.hh"
 #include "../main/genome_util.hh"
 #include "../main/organism.hh"
 #include "../main/phenotype.hh"
@@ -23,8 +24,6 @@
 #include "test_cpu.hh"
 #include <limits.h>
 
-using namespace std;
-
 
 using namespace std;
 
@@ -148,6 +147,7 @@
   stack.LoadState(fp);
 
   char marker; fp>>marker; assert( marker == '|' );
+#ifdef USE_INST_SET_CODE
   /* YIKES!  data loss below: */
   char the_cur_stack = cur_stack;
   char the_cur_head = cur_head;
@@ -155,6 +155,11 @@
   fp.get(the_cur_stack);
   fp.get(the_cur_head);
   fp.get(the_input_pointer);
+#else /* USE_INST_SET_CODE */
+  fp.get((char)cur_stack);
+  fp.get((char)cur_head);
+  fp.get((char)input_pointer);
+#endif /* USE_INST_SET_CODE */
 
   // IO buffers
   input_buf.LoadState(fp);
@@ -166,6 +171,7 @@
 }
 
 
+#ifdef USE_INST_SET_CODE
 ///////////////
 //  cInstLibCPU
 ///////////////
@@ -221,12 +227,13 @@
   const cInstruction & GetInstDefault(){ return inst_default; }
   const cInstruction & GetInstError(){ return inst_error; }
 };
-
+#endif /* USE_INST_SET_CODE */
 
 ///////////////
 //  cHardwareCPU
 ///////////////
 
+#ifdef USE_INST_SET_CODE
 const cInstruction cInstLibCPU::inst_error(255);
 const cInstruction cInstLibCPU::inst_default(0);
 cInstLibBase *cHardwareCPU::GetInstLib(){ return s_inst_slib; }
@@ -250,9 +257,17 @@
     tHardwareCPUMethod function;
   };
   static const cInstEntryCPU s_f_array[] = {
+    /*
+    Note: all entries of cNOPEntryCPU s_n_array must have corresponding
+    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),
@@ -447,6 +462,11 @@
   };
 
   const int n_size = sizeof(s_n_array)/sizeof(cNOPEntryCPU);
+
+  cout << "<cHardwareCPU::initInstLib> Instruction Library has "
+  << n_size << " instructions." << endl;
+
+
   static cString n_names[n_size];
   static int nop_mods[n_size];
   for (int i = 0; i < n_size; i++){
@@ -472,7 +492,7 @@
   );
 
   cout <<
-  "<cHardwareCPU::initInstLib> test of ick" <<endl<<
+  "<cHardwareCPU::initInstLib> debug: important post-init values:" <<endl<<
   " --- GetSize(): " << inst_lib->GetSize() <<endl<<
   " --- GetNumNops(): " << inst_lib->GetNumNops() <<endl<<
   " --- GetName(last): " <<
@@ -481,13 +501,16 @@
 
   return inst_lib;
 }
+#endif /* USE_INST_SET_CODE */
 
 cHardwareCPU::cHardwareCPU(cOrganism * in_organism, cInstSet * in_inst_set)
   : cHardwareBase(in_organism, in_inst_set)
 {
+#ifdef USE_INST_SET_CODE
   /* FIXME:  reorganize storage of m_functions.  -- kgn */
   m_functions = s_inst_slib->GetFunctions();
   /**/
+#endif /* USE_INST_SET_CODE */
   memory = in_organism->GetGenome();  // Initialize memory...
   Reset();                            // Setup the rest of the hardware...
 }
@@ -627,18 +650,25 @@
 bool cHardwareCPU::SingleProcess_ExecuteInst(const cInstruction & cur_inst) 
 {
   // Get a pointer to the corrisponding method...
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  //tHardwareMethod inst_ptr = GetInstSet().GetFunction(cur_inst);
   int inst_idx = GetInstSet().GetLibFunctionIndex(cur_inst);
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+  tHardwareMethod inst_ptr = GetInstSet().GetFunction(cur_inst);
+#endif /* USE_INST_SET_CODE */
       
   // Mark the instruction as executed
   IP().FlagExecuted() = true;
 	
 #ifdef EXECUTION_ERRORS
   // If there is an execution error, execute a random instruction.
+#ifdef USE_INST_SET_CODE
+  if (organism->TestExeErr()) inst_idx = GetInstSet().GetRandFunctionIndex();
+#else /* USE_INST_SET_CODE */
   if (organism->TestExeErr()) inst_ptr = GetInstSet().GetRandFunction();
-#endif
+#endif /* USE_INST_SET_CODE */
+#endif /* EXECUTION_ERRORS */
 	
 #ifdef INSTRUCTION_COUNT
   // instruction execution count incremeneted
@@ -646,12 +676,15 @@
 #endif
 	
   // And execute it.
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  //const bool exec_success = (this->*inst_ptr)();
   const bool exec_success
   //= (this->*(s_inst_slib->GetFunctions()[inst_idx]))();
   = (this->*(m_functions[inst_idx]))();
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+  const bool exec_success = (this->*inst_ptr)();
+#endif /* USE_INST_SET_CODE */
 	
 #ifdef INSTRUCTION_COUNT
   // decremenet if the instruction was not executed successfully
Index: avida/current/source/cpu/hardware_factory.cc
diff -u avida/current/source/cpu/hardware_factory.cc:1.8 avida/current/source/cpu/hardware_factory.cc:1.8.2.1
--- avida/current/source/cpu/hardware_factory.cc:1.8	Mon May 19 12:30:07 2003
+++ avida/current/source/cpu/hardware_factory.cc	Fri May 23 12:05:36 2003
@@ -12,7 +12,7 @@
 
 #include "hardware_base.hh"
 #include "hardware_cpu.hh"
-
+#include "hardware_4stack.hh"
 
 using namespace std;
 
@@ -33,7 +33,12 @@
   // If there is nothing to recycle, just create a new one.
   if (hardware_cpu_list.GetSize() == 0) {
     new_count++;
-    new_hardware = new cHardwareCPU(in_org, inst_set);
+    if (type == HARDWARE_TYPE_CPU_ORIGINAL) {
+      new_hardware = new cHardwareCPU(in_org, inst_set);
+    }
+    else if (type == HARDWARE_TYPE_CPU_4STACK) {
+      new_hardware = new cHardware4Stack(in_org, inst_set);
+    }
   }
 
   // If we do have hardware to recycle, do so!
Index: avida/current/source/cpu/hardware_util.cc
diff -u avida/current/source/cpu/hardware_util.cc:1.23 avida/current/source/cpu/hardware_util.cc:1.23.2.1
--- avida/current/source/cpu/hardware_util.cc:1.23	Mon May 19 12:30:07 2003
+++ avida/current/source/cpu/hardware_util.cc	Fri May 23 12:05:36 2003
@@ -5,9 +5,6 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
-#include "hardware_method.hh"
-#include "hardware_util.hh"
-
 #include "../tools/string.hh"
 #include "../tools/file.hh"
 
@@ -15,6 +12,9 @@
 #include "../main/inst_util.hh"
 #include "../main/config.hh"
 
+#include "hardware_method.hh"
+#include "hardware_util.hh"
+
 #include "hardware_base.hh"
 #include "hardware_cpu.hh"
 #include "hardware_4stack.hh"
@@ -22,14 +22,17 @@
 using namespace std;
 
 
+#ifdef USE_INST_SET_CODE
 void cHardwareUtil::LoadInstSet(const cString & filename, cInstSet & inst_set, 
 				tDictionary<int> & nop_dict,
-				tDictionary<tHardwareMethod> & inst_dict,
-                                /* XXX start -- kgn */
-				tDictionary<int> & nop_dict_2,
-				tDictionary<int> & inst_dict_2)
-                                /* XXX end */
-{
+				tDictionary<int> & inst_dict
+){
+#else /* USE_INST_SET_CODE */
+void cHardwareUtil::LoadInstSet(const cString & filename, cInstSet & inst_set, 
+				tDictionary<int> & nop_dict,
+				tDictionary<tHardwareMethod> & inst_dict
+){
+#endif /* USE_INST_SET_CODE */
   cInitFile file(filename);
   file.Load();
   file.Compress();
@@ -52,35 +55,45 @@
     
     // Otherwise, this instruction will be in the set.
     // First, determine if it is a nop...
+#ifdef USE_INST_SET_CODE
+    /* XXX start -- kgn */
+    int nop_mod = -1;
+    if(nop_dict.Find(inst_name, nop_mod) == true) {
+      inst_set.AddNop2(nop_mod, redundancy, ft_cost, cost, prob_fail);
+      continue;
+    }
+    /* XXX end */
+#else /* USE_INST_SET_CODE */
     int nop_mod = -1;
     /* XXX start -- kgn */
     int nop_mod_2 = -1;
     /* XXX end */
     if (nop_dict.Find(inst_name, nop_mod) == true) {
       inst_set.AddNop(inst_name, &cHardwareBase::Inst_Nop, nop_mod,
-		 redundancy, ft_cost, cost, prob_fail);
-      /* XXX start -- kgn */
-      if(nop_dict_2.Find(inst_name, nop_mod_2) == true) {
-        inst_set.AddNop2(nop_mod_2, redundancy, ft_cost, cost, prob_fail);
-      } else { /* dicts mismatch! die horribly. */ exit(1); }
-      /* XXX end */
+		      redundancy, ft_cost, cost, prob_fail);
       continue;
     }
+#endif /* USE_INST_SET_CODE */
 
     // Otherwise, it had better be in the main dictionary...
+#ifdef USE_INST_SET_CODE
+    /* XXX start -- kgn */
+    int fun_id = -1;
+    if(inst_dict.Find(inst_name, fun_id) == true){
+      inst_set.Add2(fun_id, redundancy, ft_cost, cost, prob_fail);
+      continue;
+    }
+    /* XXX end */
+#else /* USE_INST_SET_CODE */
     tHardwareMethod cpu_method = NULL;
     /* XXX start -- kgn */
     int fun_id = -1;
     /* XXX end */
     if (inst_dict.Find(inst_name, cpu_method) == true) {
       inst_set.Add(inst_name, cpu_method, redundancy, ft_cost, cost, prob_fail);
-      /* XXX start -- kgn */
-      if(inst_dict_2.Find(inst_name, fun_id) == true){
-        inst_set.Add2(fun_id, redundancy, ft_cost, cost, prob_fail);
-      } else { /* dicts mismatch! die horribly. */ exit(1); }
-      /* XXX end */
       continue;
     }
+#endif /* USE_INST_SET_CODE */
 
     // Oh oh!  Didn't find an instruction!
     cerr << endl
@@ -98,12 +111,15 @@
 {
   // Nops (or other modifying-instructions...)  Note: Nops must be the
   //  first instructions added to the set.
+#ifndef USE_INST_SET_CODE
   tDictionary< int > nop_dict;
   nop_dict.Add("nop-A", REG_AX);
   nop_dict.Add("nop-B", REG_BX);
   nop_dict.Add("nop-C", REG_CX);
+#endif /* !USE_INST_SET_CODE */
 
   // Build a dictionary of instructions and their corresponding methods...
+#ifndef USE_INST_SET_CODE
   tDictionary< tHardwareMethod > inst_dict;
 
   // Remaining instructions.
@@ -306,31 +322,37 @@
   // Placebo instructions
   // nop-x (included with nops)
   inst_dict.Add("skip", (tHardwareMethod) &cHardwareCPU::Inst_Skip);
+#endif /* !USE_INST_SET_CODE */
   
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  tDictionary<int> nop_dict_2;
+  tDictionary<int> nop_dict;
   for(int i=0; i<inst_set.GetInstLib()->GetNumNops(); i++)
-    nop_dict_2.Add(inst_set.GetInstLib()->GetNopName(i), i);
+    nop_dict.Add(inst_set.GetInstLib()->GetNopName(i), i);
 
-  tDictionary<int> inst_dict_2;
+  tDictionary<int> inst_dict;
   for(int i=0; i<inst_set.GetInstLib()->GetSize(); i++)
-    inst_dict_2.Add(inst_set.GetInstLib()->GetName(i), i);
+    inst_dict.Add(inst_set.GetInstLib()->GetName(i), i);
   /* XXX end */
+#endif /* USE_INST_SET_CODE */
 
   // And load it on up!
-  LoadInstSet(filename, inst_set, nop_dict, inst_dict, nop_dict_2, inst_dict_2);
+  LoadInstSet(filename, inst_set, nop_dict, inst_dict);
 }
 
 void cHardwareUtil::LoadInstSet_CPU4Stack(const cString & filename, cInstSet & inst_set)
 {
   // Nops (or other modifying-instructions...)  Note: Nops must be the
   //  first instructions added to the set.
+#ifndef USE_INST_SET_CODE
   tDictionary< int > nop_dict;
   nop_dict.Add("nop-A", REG_AX);
   nop_dict.Add("nop-B", REG_BX);
   nop_dict.Add("nop-C", REG_CX);
+#endif /* !USE_INST_SET_CODE */
 
   // Build a dictionary of instructions and their corresponding methods...
+#ifndef USE_INST_SET_CODE
   tDictionary< tHardwareMethod > inst_dict;
 
   // Remaining instructions.
@@ -379,7 +401,7 @@
   inst_dict.Add("pop-A",  (tHardwareMethod) &cHardware4Stack::Inst_PopA);
   inst_dict.Add("pop-B",  (tHardwareMethod) &cHardware4Stack::Inst_PopB);
   inst_dict.Add("pop-C",  (tHardwareMethod) &cHardware4Stack::Inst_PopC);
-  inst_dict.Add("push-A", (tHardwareMethod) &cHardware4Stack::Inst_PushA);
+  // inst_dict.Add("push-A", (tHardwareMethod) &cHardware4Stack::Inst_PushA);
   inst_dict.Add("push-B", (tHardwareMethod) &cHardware4Stack::Inst_PushB);
   inst_dict.Add("push-C", (tHardwareMethod) &cHardware4Stack::Inst_PushC);
 
@@ -533,19 +555,26 @@
   // Placebo instructions
   // nop-x (included with nops)
   inst_dict.Add("skip", (tHardwareMethod) &cHardware4Stack::Inst_Skip);
+#endif /* !USE_INST_SET_CODE */
   
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
-  tDictionary<int> nop_dict_2;
+  tDictionary<int> nop_dict;
   for(int i=0; i<inst_set.GetInstLib()->GetNumNops(); i++)
-    nop_dict_2.Add(inst_set.GetInstLib()->GetNopName(i), i);
+    nop_dict.Add(inst_set.GetInstLib()->GetNopName(i), i);
 
-  tDictionary<int> inst_dict_2;
+  tDictionary<int> inst_dict;
   for(int i=0; i<inst_set.GetInstLib()->GetSize(); i++)
-    inst_dict_2.Add(inst_set.GetInstLib()->GetName(i), i);
+    inst_dict.Add(inst_set.GetInstLib()->GetName(i), i);
   /* XXX end */
+#endif /* USE_INST_SET_CODE */
+
+  cout << "Instruction Library in util has " << inst_dict.GetSize()
+       << " instructions." << endl;
+
 
   // And load it on up!
-  LoadInstSet(filename, inst_set, nop_dict, inst_dict, nop_dict_2, inst_dict_2);
+  LoadInstSet(filename, inst_set, nop_dict, inst_dict);
 }
 
 cInstSet & cHardwareUtil::DefaultInstSet(const cString & inst_filename)
@@ -556,11 +585,15 @@
   // set it up.
   if (inst_filename != "" && inst_set.GetSize() == 0) {
     if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+#ifdef USE_INST_SET_CODE
       inst_set.SetInstLib(cHardwareCPU::GetInstLib());
+#endif /* USE_INST_SET_CODE */
       LoadInstSet_CPUOriginal(inst_filename, inst_set);
     }
     else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+#ifdef USE_INST_SET_CODE
       inst_set.SetInstLib(cHardware4Stack::GetInstLib());
+#endif /* USE_INST_SET_CODE */
       LoadInstSet_CPU4Stack(inst_filename, inst_set);
     }
   }
Index: avida/current/source/cpu/hardware_util.hh
diff -u avida/current/source/cpu/hardware_util.hh:1.6 avida/current/source/cpu/hardware_util.hh:1.6.2.1
--- avida/current/source/cpu/hardware_util.hh:1.6	Mon May 19 12:30:07 2003
+++ avida/current/source/cpu/hardware_util.hh	Fri May 23 12:05:36 2003
@@ -19,14 +19,21 @@
 
 class cHardwareUtil {
 public:
+#ifdef USE_INST_SET_CODE
   static void LoadInstSet(
     const cString & filename,
     cInstSet & inst_set, 
 		tDictionary<int> & nop_dict,
-		tDictionary<tHardwareMethod> & inst_dict,
-		tDictionary<int> & nop_dict_2,
-		tDictionary<int> & inst_dict_2
+		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
+  );
+#endif /* USE_INST_SET_CODE */
   static void LoadInstSet_CPUOriginal(const cString & filename,
 				      cInstSet & inst_set);
   static void LoadInstSet_CPU4Stack(const cString & filename,
Index: avida/current/source/event/Makefile.am
diff -u avida/current/source/event/Makefile.am:1.13 avida/current/source/event/Makefile.am:1.13.2.1
--- avida/current/source/event/Makefile.am:1.13	Sat May 17 02:48:08 2003
+++ avida/current/source/event/Makefile.am	Fri May 23 12:05:37 2003
@@ -1,4 +1,5 @@
 
+
 ## This is a somewhat ugly hack to build the autogenerated code.
 ## We pretend that the autogenerated code is actually a program, then
 ## make builds it correctly. Any other way leads to unnecessary 
Index: avida/current/source/main/Makefile.am
diff -u avida/current/source/main/Makefile.am:1.26 avida/current/source/main/Makefile.am:1.26.2.1
--- avida/current/source/main/Makefile.am:1.26	Sat May 17 14:54:54 2003
+++ avida/current/source/main/Makefile.am	Fri May 23 12:05:37 2003
@@ -1,3 +1,4 @@
+
 CPPFLAGS = @CPPFLAGS@
 
 #
Index: avida/current/source/main/analyze.cc
diff -u avida/current/source/main/analyze.cc:1.70 avida/current/source/main/analyze.cc:1.70.2.1
--- avida/current/source/main/analyze.cc:1.70	Mon May 19 21:07:33 2003
+++ avida/current/source/main/analyze.cc	Fri May 23 12:05:37 2003
@@ -1805,10 +1805,31 @@
       col_fail_count[i] = 0;
     }
 
-    // Build an empty instruction into the an instruction library.
     cInstSet map_inst_set(inst_set);
+#ifdef USE_INST_SET_CODE
+    /* XXX start -- kgn */
+    // Locate instruction corresponding to "map-null" in the instruction library.
+    {
+      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("map-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 << " --- (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;
+        exit(1);
+      }
+      // Add mapping to located instruction. 
+      map_inst_set.Add2(inst_lib_null_inst.GetOp());
+    }
+    const cInstruction null_inst = map_inst_set.GetInst("map-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");
+#endif /* USE_INST_SET_CODE */
 
     // Loop through all the lines of code, testing the removal of each.
     for (int line_num = 0; line_num < max_line; line_num++) {
@@ -1995,8 +2016,30 @@
 
     // Build an empty instruction into the an instruction library.
     cInstSet map_inst_set(inst_set);
+#ifdef USE_INST_SET_CODE
+    /* XXX start -- kgn */
+    // Locate instruction corresponding to "map-null" in the instruction library.
+    {
+      const cInstruction inst_lib_null_inst = map_inst_set.GetInstLib()->GetInst("map-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 << " --- (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;
+        exit(1);
+      }
+      // Add mapping to located instruction. 
+      map_inst_set.Add2(inst_lib_null_inst.GetOp());
+    }
+    const cInstruction null_inst = map_inst_set.GetInst("map-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");
+#endif /* USE_INST_SET_CODE */
 
     cString color_string;  // For coloring cells...
 
Index: avida/current/source/main/avida.cc
diff -u avida/current/source/main/avida.cc:1.41 avida/current/source/main/avida.cc:1.41.2.1
--- avida/current/source/main/avida.cc:1.41	Mon May 19 12:30:07 2003
+++ avida/current/source/main/avida.cc	Fri May 23 12:05:37 2003
@@ -79,14 +79,19 @@
     cerr << "Unable to load environment... aborting!" << endl;
     ExitAvida(-1);
   }
+
   
   if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+#ifdef USE_INST_SET_CODE
     environment.GetInstSet().SetInstLib(cHardwareCPU::GetInstLib());
+#endif /* USE_INST_SET_CODE */
     cHardwareUtil::LoadInstSet_CPUOriginal(cConfig::GetInstFilename(),
 					   environment.GetInstSet());
   }
   else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+#ifdef USE_INST_SET_CODE
     environment.GetInstSet().SetInstLib(cHardware4Stack::GetInstLib());
+#endif /* USE_INST_SET_CODE */
     cHardwareUtil::LoadInstSet_CPU4Stack(cConfig::GetInstFilename(),
 					   environment.GetInstSet());
   }
Index: avida/current/source/main/callback_util.cc
diff -u avida/current/source/main/callback_util.cc:1.19 avida/current/source/main/callback_util.cc:1.19.2.1
--- avida/current/source/main/callback_util.cc:1.19	Sat May 17 14:23:26 2003
+++ avida/current/source/main/callback_util.cc	Fri May 23 12:05:37 2003
@@ -39,7 +39,8 @@
 
   // For the moment, we only have one hardware type...
   assert(inst_set != NULL && inst_set->OK());
-  cHardwareBase * new_hardware = cHardwareFactory::Create(owner, inst_set);
+  cHardwareBase * new_hardware =
+    cHardwareFactory::Create(owner, inst_set, cConfig::GetHardwareType());
 
   return new_hardware;
 }
Index: avida/current/source/main/inst_set.cc
diff -u avida/current/source/main/inst_set.cc:1.1 avida/current/source/main/inst_set.cc:1.1.4.1
--- avida/current/source/main/inst_set.cc:1.1	Sat May 17 14:54:54 2003
+++ avida/current/source/main/inst_set.cc	Fri May 23 12:05:37 2003
@@ -19,22 +19,34 @@
 
 // Initialize static variables
 /* XXX start -- kgn */
+#ifdef USE_INST_SET_CODE
 cInstruction cInstSet::inst_default2(   0 );
 cInstruction cInstSet::inst_error2  ( 255 );
+#else /* USE_INST_SET_CODE */
 /* XXX end */
 const cInstruction cInstSet::inst_default(   0 );
 const cInstruction cInstSet::inst_error  ( 255 );
+#endif /* USE_INST_SET_CODE */
 
 cInstSet::cInstSet()
 {
 }
 
+#ifdef USE_INST_SET_CODE
+cInstSet::cInstSet(const cInstSet & in_inst_set)
+  : m_lib_name_map(in_inst_set.m_lib_name_map)
+  , m_lib_nopmod_map(in_inst_set.m_lib_nopmod_map)
+  , mutation_chart2(in_inst_set.mutation_chart2)
+{
+}
+#else /* USE_INST_SET_CODE */
 cInstSet::cInstSet(const cInstSet & in_inst_set)
   : inst_array(in_inst_set.inst_array)
   , nop_mods(in_inst_set.nop_mods)
   , mutation_chart(in_inst_set.mutation_chart)
 {
 }
+#endif /* USE_INST_SET_CODE */
 
 cInstSet::~cInstSet()
 {
@@ -43,36 +55,23 @@
 cInstSet & cInstSet::operator=(const cInstSet & _in)
 {
   /* XXX start -- kgn */
+#ifdef USE_INST_SET_CODE
   m_inst_lib = _in.m_inst_lib;
   m_lib_name_map = _in.m_lib_name_map;
   m_lib_nopmod_map = _in.m_lib_nopmod_map;
   mutation_chart2 = _in.mutation_chart2;
+#else /* USE_INST_SET_CODE */
   /* XXX end */
   inst_array = _in.inst_array;
   nop_mods = _in.nop_mods;
   mutation_chart = _in.mutation_chart;
+#endif /* USE_INST_SET_CODE */
   return *this;
 }
 
 bool cInstSet::OK() const
 {
-  //// assert(inst_array.OK());
-  //// assert(nop_mods.OK());
-  //assert(inst_array.GetSize() < 256);
-  //assert(nop_mods.GetSize() < inst_array.GetSize());
-
-  //// Make sure that all of the redundancies are represented the appropriate
-  //// number of times.
-  //tArray<int> test_redundancy(inst_array.GetSize());
-  //test_redundancy.SetAll(0);
-  //for (int i = 0; i < mutation_chart.GetSize(); i++) {
-  //  int test_id = mutation_chart[i];
-  //  test_redundancy[test_id]++;
-  //}
-  //for (int i = 0; i < inst_array.GetSize(); i++) {
-  //  assert(inst_array[i].redundancy == test_redundancy[i]);
-  //}
-
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
   assert(m_lib_name_map.GetSize() < 256);
   assert(m_lib_nopmod_map.GetSize() < m_lib_name_map.GetSize());
@@ -82,81 +81,48 @@
   tArray<int> test_redundancy2(m_lib_name_map.GetSize());
   test_redundancy2.SetAll(0);
   for (int i = 0; i < mutation_chart2.GetSize(); i++) {
-    int test_id = mutation_chart[i];
+    int test_id = mutation_chart2[i];
     test_redundancy2[test_id]++;
   }
   for (int i = 0; i < m_lib_name_map.GetSize(); i++) {
     assert(m_lib_name_map[i].redundancy == test_redundancy2[i]);
   }
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+
+  // assert(inst_array.OK());
+  // assert(nop_mods.OK());
+  assert(inst_array.GetSize() < 256);
+  assert(nop_mods.GetSize() < inst_array.GetSize());
+
+  // Make sure that all of the redundancies are represented the appropriate
+  // number of times.
+  tArray<int> test_redundancy(inst_array.GetSize());
+  test_redundancy.SetAll(0);
+  for (int i = 0; i < mutation_chart.GetSize(); i++) {
+    int test_id = mutation_chart[i];
+    test_redundancy[test_id]++;
+  }
+  for (int i = 0; i < inst_array.GetSize(); i++) {
+    assert(inst_array[i].redundancy == test_redundancy[i]);
+  }
+#endif /* USE_INST_SET_CODE */
 
   return true;
 }
 
 cInstruction cInstSet::GetRandomInst() const
 {
-  ///* XXX start -- kgn */
-  //if(mutation_chart.GetSize() != mutation_chart2.GetSize()){
-  //  cout << "<cInstSet::GetRandomInst> mutation_charts'.GetSize()es mismatch!" << endl;
-  //}
-  //unsigned int rand = g_random.GetUInt(mutation_chart.GetSize());
-  //int inst_op = mutation_chart[rand];
-  //int inst_op2 = mutation_chart2[rand];
-  //if(inst_op != inst_op2){
-  //  cout << "<cInstSet::GetRandomInst> inst_op, inst_op2 mismatch!" << endl;
-  //}
-  ///* XXX end */
-
-  ////int inst_op = mutation_chart[g_random.GetUInt(mutation_chart.GetSize())];
-
+#ifdef USE_INST_SET_CODE
   int inst_op = mutation_chart2[g_random.GetUInt(mutation_chart2.GetSize())];
+#else /* USE_INST_SET_CODE */
+  int inst_op = mutation_chart[g_random.GetUInt(mutation_chart.GetSize())];
+#endif /* USE_INST_SET_CODE */
   return cInstruction(inst_op);
 }
 
-int cInstSet::Add(const cString & _name, tHardwareMethod _fun,
-		  const int redundancy, const int ft_cost, const int cost,
-		  const double prob_fail)
-{
-  const int inst_id = inst_array.GetSize();
-
-  assert(inst_id < 255);
-
-  // Increase the size of the array...
-  inst_array.Resize(inst_id + 1);
-
-  // Setup the new function...
-  inst_array[inst_id].name = _name;
-  inst_array[inst_id].function = _fun;
-  inst_array[inst_id].redundancy = redundancy;
-  inst_array[inst_id].cost = cost;
-  inst_array[inst_id].ft_cost = ft_cost;
-  inst_array[inst_id].prob_fail = prob_fail;
-
-  const int total_redundancy = mutation_chart.GetSize();
-  mutation_chart.Resize(total_redundancy + redundancy);
-  for (int i = 0; i < redundancy; i++) {
-    mutation_chart[total_redundancy + i] = inst_id;
-  }
-
-  return inst_id;
-}
-
-int cInstSet::AddNop(const cString & _name, tHardwareMethod _fun,
-		     const int reg, const int redundancy, const int ft_cost,
-		     const int cost, const double prob_fail)
-{ 
-  // Assert nops are at the _beginning_ of an inst_set.
-  assert(inst_array.GetSize() == nop_mods.GetSize());
-
-  const int inst_id = Add(_name, _fun, redundancy, ft_cost, cost, prob_fail);
-
-  nop_mods.Resize(inst_id + 1);
-  nop_mods[inst_id] = reg;
-
-  return inst_id;
-}
-
 /**/
+#ifdef USE_INST_SET_CODE
 int cInstSet::Add2(
   const int lib_fun_id,
   const int redundancy,
@@ -206,15 +172,65 @@
 
   return inst_id;
 }
+#else /* USE_INST_SET_CODE */
 /**/
 
+int cInstSet::Add(const cString & _name, tHardwareMethod _fun,
+		  const int redundancy, const int ft_cost, const int cost,
+		  const double prob_fail)
+{
+  const int inst_id = inst_array.GetSize();
+
+  assert(inst_id < 255);
+
+  // Increase the size of the array...
+  inst_array.Resize(inst_id + 1);
+
+  // Setup the new function...
+  inst_array[inst_id].name = _name;
+  inst_array[inst_id].function = _fun;
+  inst_array[inst_id].redundancy = redundancy;
+  inst_array[inst_id].cost = cost;
+  inst_array[inst_id].ft_cost = ft_cost;
+  inst_array[inst_id].prob_fail = prob_fail;
+
+  const int total_redundancy = mutation_chart.GetSize();
+  mutation_chart.Resize(total_redundancy + redundancy);
+  for (int i = 0; i < redundancy; i++) {
+    mutation_chart[total_redundancy + i] = inst_id;
+  }
+
+  return inst_id;
+}
+
+int cInstSet::AddNop(const cString & _name, tHardwareMethod _fun,
+		     const int reg, const int redundancy, const int ft_cost,
+		     const int cost, const double prob_fail)
+{ 
+  // Assert nops are at the _beginning_ of an inst_set.
+  assert(inst_array.GetSize() == nop_mods.GetSize());
+
+  const int inst_id = Add(_name, _fun, redundancy, ft_cost, cost, prob_fail);
+
+  nop_mods.Resize(inst_id + 1);
+  nop_mods[inst_id] = reg;
+
+  return inst_id;
+}
+#endif /* USE_INST_SET_CODE */
+
 cString cInstSet::FindBestMatch(const cString & in_name) const
 {
   int best_dist = 1024;
   cString best_name("");
   
+#ifdef USE_INST_SET_CODE
+  for (int i = 0; i < m_lib_name_map.GetSize(); i++) {
+    const cString & cur_name = m_inst_lib->GetName(m_lib_name_map[i].lib_fun_id);
+#else /* USE_INST_SET_CODE */
   for (int i = 0; i < inst_array.GetSize(); i++) {
     const cString & cur_name = inst_array[i].name;
+#endif /* USE_INST_SET_CODE */
     const int cur_dist = cStringUtil::EditDistance(cur_name, in_name);
     if (cur_dist < best_dist) {
       best_dist = cur_dist;
Index: avida/current/source/main/inst_set.hh
diff -u avida/current/source/main/inst_set.hh:1.1 avida/current/source/main/inst_set.hh:1.1.4.1
--- avida/current/source/main/inst_set.hh:1.1	Sat May 17 14:54:54 2003
+++ avida/current/source/main/inst_set.hh	Fri May 23 12:05:37 2003
@@ -35,6 +35,7 @@
  **/
 
 class cInstSet {
+#ifdef USE_INST_SET_CODE
 public:
   cInstLibBase *m_inst_lib;
   class cInstEntry2 {
@@ -52,6 +53,7 @@
   static cInstruction inst_error2;
   // static const cInstruction inst_none;
   static cInstruction inst_default2;
+#else /* USE_INST_SET_CODE */
 private:
   // This class gives full info about a single instruction in the library.
   class cInstEntry {
@@ -67,13 +69,13 @@
   tArray<cInstEntry> inst_array;  // The instructions indexed by ID
   tArray<int> nop_mods;           // Modification table for nops
   tArray<int> mutation_chart;     // ID's represented by redundancy values.
+#endif /* USE_INST_SET_CODE */
 
   // Static components...
   static const cInstruction inst_error;
   // static const cInstruction inst_none;
   static const cInstruction inst_default;
 
-
 public:
   cInstSet();
   cInstSet(const cInstSet & in_inst_set);
@@ -86,14 +88,13 @@
   // Accessors
   const cString & GetName(int id) const
   { 
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array[id].name
-    //  !=m_inst_lib->GetName(m_lib_name_map[id].lib_fun_id)
-    //){ std::cout << "<cInstSet::GetName> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array[id].name;
-
     return m_inst_lib->GetName(m_lib_name_map[id].lib_fun_id);
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return inst_array[id].name;
+#endif /* USE_INST_SET_CODE */
   }
   const cString & GetName(const cInstruction & inst) const
   {
@@ -101,117 +102,116 @@
   }
   int GetCost(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array[inst.GetOp()].cost
-    //  !=m_lib_name_map[inst.GetOp()].cost
-    //){ std::cout << "<cInstSet::GetCost> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array[inst.GetOp()].cost;
-
     return m_lib_name_map[inst.GetOp()].cost;
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return inst_array[inst.GetOp()].cost;
+#endif /* USE_INST_SET_CODE */
   }
   int GetFTCost(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array[inst.GetOp()].ft_cost
-    //  !=m_lib_name_map[inst.GetOp()].ft_cost
-    //){ std::cout << "<cInstSet::GetFTCost> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array[inst.GetOp()].ft_cost;
-
     return m_lib_name_map[inst.GetOp()].ft_cost;
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return inst_array[inst.GetOp()].ft_cost;
+#endif /* USE_INST_SET_CODE */
   }
   double GetProbFail(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array[inst.GetOp()].prob_fail
-    //  !=m_lib_name_map[inst.GetOp()].prob_fail
-    //){ std::cout << "<cInstSet::GetProbFail> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array[inst.GetOp()].prob_fail;
-
     return m_lib_name_map[inst.GetOp()].prob_fail;
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return inst_array[inst.GetOp()].prob_fail;
+#endif /* USE_INST_SET_CODE */
   }
   int GetRedundancy(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array[inst.GetOp()].redundancy
-    //  !=m_lib_name_map[inst.GetOp()].redundancy
-    //){ std::cout << "<cInstSet::GetRedundancy> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array[inst.GetOp()].redundancy;
-
     return m_lib_name_map[inst.GetOp()].redundancy;
+#else /* USE_INST_SET_CODE */
+    ///* XXX end */
+    return inst_array[inst.GetOp()].redundancy;
+#endif /* USE_INST_SET_CODE */
   }
 
-  tHardwareMethod GetFunction(const cInstruction & inst) const
-  {
-    return inst_array[inst.GetOp()].function;
-  }
-
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
   int GetLibFunctionIndex(const cInstruction & inst) const
   {
     return m_lib_name_map[inst.GetOp()].lib_fun_id;
   }
   /* XXX end */
+#else /* USE_INST_SET_CODE */
+  tHardwareMethod GetFunction(const cInstruction & inst) const
+  {
+    return inst_array[inst.GetOp()].function;
+  }
+#endif /* USE_INST_SET_CODE */
 
   int GetNopMod(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( nop_mods[inst.GetOp()]
-    //  !=m_inst_lib->GetNopMod(m_lib_nopmod_map[inst.GetOp()])
-    //){ std::cout << "<cInstSet::GetNopMod> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return nop_mods[inst.GetOp()];
-
     return m_inst_lib->GetNopMod(m_lib_nopmod_map[inst.GetOp()]);
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return nop_mods[inst.GetOp()];
+#endif /* USE_INST_SET_CODE */
   }
 
   cInstruction GetRandomInst() const;
+#ifdef USE_INST_SET_CODE
+  int GetRandFunctionIndex() const
+  {
+    return m_lib_name_map[ GetRandomInst().GetOp() ].lib_fun_id;
+  }
+#else /* USE_INST_SET_CODE */
   tHardwareMethod GetRandFunction() const
   {
     return inst_array[ GetRandomInst().GetOp() ].function;
   }
+#endif /* USE_INST_SET_CODE */
 
   int GetSize() const {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( inst_array.GetSize() != m_lib_name_map.GetSize() )
-    //{ std::cout << "<cInstSet::GetSize> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return inst_array.GetSize();
-
     return m_lib_name_map.GetSize();
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return inst_array.GetSize();
+#endif /* USE_INST_SET_CODE */
   }
   int GetNumNops() const {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( nop_mods.GetSize() != m_lib_nopmod_map.GetSize() )
-    //{ std::cout << "<cInstSet::GetNumNops> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return nop_mods.GetSize();
-
     return m_lib_nopmod_map.GetSize();
+#else /* USE_INST_SET_CODE */
+    ///* XXX end */
+    return nop_mods.GetSize();
+#endif /* USE_INST_SET_CODE */
   }
 
   // Instruction Analysis.
   int IsNop(const cInstruction & inst) const
   {
+#ifdef USE_INST_SET_CODE
     ///* XXX start -- kgn */
-    //if( nop_mods.GetSize() != m_lib_nopmod_map.GetSize() )
-    //{ std::cout << "<cInstSet::IsNop> mismatch!" << std::endl; }
-    ///* XXX end */
-    //return (inst.GetOp() < nop_mods.GetSize());
-
     return (inst.GetOp() < m_lib_nopmod_map.GetSize());
+    ///* XXX end */
+#else /* USE_INST_SET_CODE */
+    return (inst.GetOp() < nop_mods.GetSize());
+#endif /* USE_INST_SET_CODE */
   }
 
   // Insertion of new instructions...
-  int Add(const cString & _name, tHardwareMethod _fun, const int redundancy=1,
-	  const int ft_cost=0, const int cost=0, const double prob_fail=0.0);
-  int AddNop(const cString & _name, tHardwareMethod _fun, const int reg,
-	     const int redundancy=1, const int ft_cost=0, const int cost=0,
-	     const double prob_fail=0.0);
-
+#ifdef USE_INST_SET_CODE
   int Add2(
     const int lib_fun_id,
     const int redundancy=1,
@@ -226,7 +226,15 @@
     const int cost=0,
     const double prob_fail=0.0
   );
+#else /* USE_INST_SET_CODE */
+  int Add(const cString & _name, tHardwareMethod _fun, const int redundancy=1,
+	  const int ft_cost=0, const int cost=0, const double prob_fail=0.0);
+  int AddNop(const cString & _name, tHardwareMethod _fun, const int reg,
+	     const int redundancy=1, const int ft_cost=0, const int cost=0,
+	     const double prob_fail=0.0);
+#endif /* USE_INST_SET_CODE */
 
+#ifdef USE_INST_SET_CODE
   /* XXX start -- kgn */
   // accessors for instruction library
   cInstLibBase *GetInstLib(){ return m_inst_lib; }
@@ -236,24 +244,33 @@
     inst_default2 = inst_lib->GetInstDefault();
   }
   /* XXX end */
+#endif /* USE_INST_SET_CODE */
 
   inline cInstruction GetInst(const cString & in_name) const;
   cString FindBestMatch(const cString & in_name) const;
 
   // Static methods..
   static const cInstruction & GetInstDefault() {
+#ifdef USE_INST_SET_CODE
     /* XXX start --- kgn */
-    if(inst_default != inst_default2)
-    { std::cout << "<cInstSet::GetInstDefault> mismatch!" << std::endl; }
+    //if(inst_default != inst_default2)
+    //{ std::cout << "<cInstSet::GetInstDefault> mismatch!" << std::endl; }
+    return inst_default2;
     /* XXX end */
+#else /* USE_INST_SET_CODE */
     return inst_default;
+#endif /* USE_INST_SET_CODE */
   }
   static const cInstruction & GetInstError()   {
     /* XXX start --- kgn */
-    if(inst_error != inst_error2)
-    { std::cout << "<cInstSet::GetInstError> mismatch!" << std::endl; }
+    //if(inst_error != inst_error2)
+    //{ std::cout << "<cInstSet::GetInstError> mismatch!" << std::endl; }
+#ifdef USE_INST_SET_CODE
+    return inst_error2;
+#else /* USE_INST_SET_CODE */
     /* XXX end */
     return inst_error;
+#endif /* USE_INST_SET_CODE */
   }
   // static const cInstruction & GetInstNone()    { return inst_none; }
 };
@@ -261,54 +278,28 @@
 
 inline cInstruction cInstSet::GetInst(const cString & in_name) const
 {
-
-  ///* XXX start --- kgn */
-  //int i, i1=-1, i2=-1;
-  //std::cout <<
-  //  "<cInstSet::GetInst> inst_array.GetSize():" <<
-  //  inst_array.GetSize() <<
-  //  std::endl;
-  //for (i = 0; i < inst_array.GetSize(); i++) {
-  //  if (inst_array[i].name == in_name){
-  //    i1 = i;
-  //  }
-  ////if (inst_array[i].name == in_name) return cInstruction(i);
-  //}
-  //std::cout <<
-  //  "<cInstSet::GetInst> i:" <<
-  //  i <<
-  //  std::endl;
-  //std::cout <<
-  //  "<cInstSet::GetInst> inst_array.GetSize():" <<
-  //  inst_array.GetSize() <<
-  //  std::endl;
-  //for (i = 0; i < m_lib_name_map.GetSize(); i++) {
-  //  if (m_inst_lib->GetName(m_lib_name_map[i].lib_fun_id) == in_name){
-  //    i2 = i;
-  //  }
-  //}
-  //std::cout <<
-  //  "<cInstSet::GetInst> i:" <<
-  //  i <<
-  //  std::endl;
-  //if(i1 != i2){
-  //  std::cout << "<cInstSet::GetInst> mismatch!" << std::endl;
-  //}
-  //if(i1>-1){ return cInstruction(i1); }
-  ///* XXX end */
-
-  //// assert(false); // Requesting ID for unknown inst.
-  //return cInstSet::GetInstError();
-
+#ifdef USE_INST_SET_CODE
   for (int i = 0; i < m_lib_name_map.GetSize(); i++) {
-    if (m_inst_lib->
-	GetName(m_lib_name_map[i].lib_fun_id) == in_name) {
+    if (m_inst_lib->GetName(m_lib_name_map[i].lib_fun_id) == in_name) {
       return cInstruction(i);
     }
   }
-
   // Adding default answer if nothing is found...
+  /*
+  FIXME:  this return value is supposed to be cInstSet::GetInstError
+  which should be the same as m_inst_lib->GetInstError().
+  -- kgn
+  */
   return cInstruction(0);
+#else /* USE_INST_SET_CODE */
+  /* XXX start --- kgn */
+  for (int i = 0; i < inst_array.GetSize(); i++) {
+    if (inst_array[i].name == in_name) return cInstruction(i);
+  }
+  // assert(false); // Requesting ID for unknown inst.
+  return cInstSet::GetInstError();
+  /* XXX end */
+#endif /* USE_INST_SET_CODE */
 }
 
 
Index: avida/current/source/qt-viewer/Makefile.am
diff -u avida/current/source/qt-viewer/Makefile.am:1.46 avida/current/source/qt-viewer/Makefile.am:1.46.2.1
--- avida/current/source/qt-viewer/Makefile.am:1.46	Sat May 17 15:40:43 2003
+++ avida/current/source/qt-viewer/Makefile.am	Fri May 23 12:05:38 2003
@@ -1,3 +1,4 @@
+
 #SUBDIRS = exp
 
 BUILT_SOURCES = qt-viewer.qmakefile
Index: avida/current/source/qt-viewer/setup_avida.cc
diff -u avida/current/source/qt-viewer/setup_avida.cc:1.21 avida/current/source/qt-viewer/setup_avida.cc:1.21.2.1
--- avida/current/source/qt-viewer/setup_avida.cc:1.21	Mon May 19 13:35:49 2003
+++ avida/current/source/qt-viewer/setup_avida.cc	Fri May 23 12:05:38 2003
@@ -80,12 +80,16 @@
   }
 
   if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+#ifdef USE_INST_SET_CODE
     environment.GetInstSet().SetInstLib(cHardwareCPU::GetInstLib());
+#endif /* USE_INST_SET_CODE */
     cHardwareUtil::LoadInstSet_CPUOriginal(cConfig::GetInstFilename(),
 					   environment.GetInstSet());
   }
   else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+#ifdef USE_INST_SET_CODE
     environment.GetInstSet().SetInstLib(cHardware4Stack::GetInstLib());
+#endif /* USE_INST_SET_CODE */
     cHardwareUtil::LoadInstSet_CPU4Stack(cConfig::GetInstFilename(),
 					   environment.GetInstSet());
   }
Index: avida/current/source/qt-viewer/exp/share/Makefile.am
diff -u avida/current/source/qt-viewer/exp/share/Makefile.am:1.1 avida/current/source/qt-viewer/exp/share/Makefile.am:1.1.4.1
--- avida/current/source/qt-viewer/exp/share/Makefile.am:1.1	Thu Dec 20 18:16:34 2001
+++ avida/current/source/qt-viewer/exp/share/Makefile.am	Fri May 23 12:05:38 2003
@@ -1,4 +1,5 @@
 
+
 sharedir = $(datadir)/share
 share_DATA = down.xpm  right.xpm
 
Index: avida/current/source/support/Makefile.am
diff -u avida/current/source/support/Makefile.am:1.10 avida/current/source/support/Makefile.am:1.10.2.1
--- avida/current/source/support/Makefile.am:1.10	Sat May 17 02:48:15 2003
+++ avida/current/source/support/Makefile.am	Fri May 23 12:05:38 2003
@@ -1,3 +1,4 @@
+
 data_DATA = analyze.cfg \
 	environment.cfg \
 	events.cfg \
Index: avida/current/source/support/preset_organisms/Makefile.am
diff -u avida/current/source/support/preset_organisms/Makefile.am:1.1 avida/current/source/support/preset_organisms/Makefile.am:1.1.4.1
--- avida/current/source/support/preset_organisms/Makefile.am:1.1	Thu Mar 28 01:24:40 2002
+++ avida/current/source/support/preset_organisms/Makefile.am	Fri May 23 12:05:38 2003
@@ -1,3 +1,4 @@
+
 presetsdir = $(datadir)/preset_organisms
 
 presets_DATA = dummy
Index: avida/current/source/third-party/Makefile.am
diff -u avida/current/source/third-party/Makefile.am:1.1 avida/current/source/third-party/Makefile.am:1.1.4.1
--- avida/current/source/third-party/Makefile.am:1.1	Thu Feb 13 12:05:19 2003
+++ avida/current/source/third-party/Makefile.am	Fri May 23 12:05:39 2003
@@ -1,2 +1,3 @@
 
+
 SUBDIRS = trio-1.9
Index: avida/current/source/third-party/trio-1.9/Makefile.am
diff -u avida/current/source/third-party/trio-1.9/Makefile.am:1.2 avida/current/source/third-party/trio-1.9/Makefile.am:1.2.2.1
--- avida/current/source/third-party/trio-1.9/Makefile.am:1.2	Sat May 17 02:48:15 2003
+++ avida/current/source/third-party/trio-1.9/Makefile.am	Fri May 23 12:05:39 2003
@@ -1,3 +1,4 @@
+
 noinst_LIBRARIES = libtrio.a
 libtrio_a_SOURCES = \
   trio.c trio.h \
Index: avida/current/source/tools/Makefile.am
diff -u avida/current/source/tools/Makefile.am:1.16 avida/current/source/tools/Makefile.am:1.16.2.1
--- avida/current/source/tools/Makefile.am:1.16	Sat May 17 02:48:15 2003
+++ avida/current/source/tools/Makefile.am	Fri May 23 12:05:39 2003
@@ -1,4 +1,5 @@
 
+
 libtools_a_SOURCES = block_struct.cc	block_struct.hh \
 		b_struct2.cc	b_struct2.hh    \
 		data_entry.cc	data_entry.hh	\
Index: avida/current/source/viewers/Makefile.am
diff -u avida/current/source/viewers/Makefile.am:1.14 avida/current/source/viewers/Makefile.am:1.14.2.1
--- avida/current/source/viewers/Makefile.am:1.14	Sat May 17 02:48:15 2003
+++ avida/current/source/viewers/Makefile.am	Fri May 23 12:05:39 2003
@@ -1,3 +1,4 @@
+
 CPPFLAGS = @CPPFLAGS@
 #LDFLAGS = -lm $(VIEW_LIBS)
 LDFLAGS = -lm -lncurses


More information about the Avida-cvs mailing list