[Avida-SVN] r3077 - branches/interrupt/source/cpu

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Tue Dec 23 12:43:13 PST 2008


Author: beckma24
Date: 2008-12-23 15:43:12 -0500 (Tue, 23 Dec 2008)
New Revision: 3077

Modified:
   branches/interrupt/source/cpu/cHardwareCPU.cc
   branches/interrupt/source/cpu/cHardwareCPU.h
Log:
Adding instructions rotate-to-next-unoccupied-cell and rotate-to-next-occupied-cell

Modified: branches/interrupt/source/cpu/cHardwareCPU.cc
===================================================================
--- branches/interrupt/source/cpu/cHardwareCPU.cc	2008-12-23 04:44:36 UTC (rev 3076)
+++ branches/interrupt/source/cpu/cHardwareCPU.cc	2008-12-23 20:43:12 UTC (rev 3077)
@@ -404,7 +404,9 @@
     tInstLibEntry<tMethod>("rotate-right-one", &cHardwareCPU::Inst_RotateRightOne, nInstFlag::STALL),
     tInstLibEntry<tMethod>("rotate-label", &cHardwareCPU::Inst_RotateLabel, nInstFlag::STALL),
     tInstLibEntry<tMethod>("rotate-to-unoccupied-cell", &cHardwareCPU::Inst_RotateUnoccupiedCell, nInstFlag::STALL),
+		tInstLibEntry<tMethod>("rotate-to-next-unoccupied-cell", &cHardwareCPU::Inst_RotateNextUnoccupiedCell, nInstFlag::STALL),
     tInstLibEntry<tMethod>("rotate-to-occupied-cell", &cHardwareCPU::Inst_RotateOccupiedCell, nInstFlag::STALL),
+		tInstLibEntry<tMethod>("rotate-to-next-occupied-cell", &cHardwareCPU::Inst_RotateNextOccupiedCell, nInstFlag::STALL),
     tInstLibEntry<tMethod>("rotate-to-event-cell", &cHardwareCPU::Inst_RotateEventCell, nInstFlag::STALL),
     
     
@@ -4198,7 +4200,17 @@
   return true;
 }
 
+bool cHardwareCPU::Inst_RotateNextOccupiedCell(cAvidaContext& ctx) {
+	organism->Rotate(1);
+	return Inst_RotateOccupiedCell(ctx);
+}
 
+bool cHardwareCPU::Inst_RotateNextUnoccupiedCell(cAvidaContext& ctx) {
+	organism->Rotate(1);
+	return Inst_RotateUnoccupiedCell(ctx);
+}
+
+
 bool cHardwareCPU::Inst_RotateEventCell(cAvidaContext& ctx) {
   const int reg_used = FindModifiedRegister(REG_BX);
   

Modified: branches/interrupt/source/cpu/cHardwareCPU.h
===================================================================
--- branches/interrupt/source/cpu/cHardwareCPU.h	2008-12-23 04:44:36 UTC (rev 3076)
+++ branches/interrupt/source/cpu/cHardwareCPU.h	2008-12-23 20:43:12 UTC (rev 3077)
@@ -535,7 +535,9 @@
   bool Inst_RotateRightOne(cAvidaContext& ctx);
   bool Inst_RotateLabel(cAvidaContext& ctx);
   bool Inst_RotateOccupiedCell(cAvidaContext& ctx);
+	bool Inst_RotateNextOccupiedCell(cAvidaContext& ctx);
   bool Inst_RotateUnoccupiedCell(cAvidaContext& ctx);
+	bool Inst_RotateNextUnoccupiedCell(cAvidaContext& ctx);
   bool Inst_RotateEventCell(cAvidaContext& ctx);
   bool Inst_SetCopyMut(cAvidaContext& ctx);
   bool Inst_ModCopyMut(cAvidaContext& ctx);




More information about the Avida-cvs mailing list