| 3156 | } |
| 3157 | |
| 3158 | bool cHardwareCPU::Inst_WriteInst(cAvidaContext& ctx) |
| 3159 | { |
| 3160 | const int src = FindModifiedRegister(REG_CX); |
| 3161 | const int op1 = REG_BX; |
| 3162 | const int op2 = REG_AX; |
| 3163 | |
| 3164 | cHeadCPU to(this, GetRegister(op2) + GetRegister(op1)); |
| 3165 | const int value = Mod(GetRegister(src), m_inst_set->GetSize()); |
| 3166 | |
| 3167 | // Change value on a mutation... checkNoMutList is for head to head |
| 3168 | //kaboom experiments |
| 3169 | if (m_organism->TestCopyMut(ctx) && !(checkNoMutList(to))) { |
| 3170 | to.SetInst(m_inst_set->GetRandomInst(ctx)); |
| 3171 | to.SetFlagMutated(); // Mark this instruction as mutated... |
| 3172 | to.SetFlagCopyMut(); // Mark this instruction as copy mut... |
| 3173 | } else { |
| 3174 | to.SetInst(Instruction(value)); |
| 3175 | to.ClearFlagMutated(); // UnMark |
| 3176 | to.ClearFlagCopyMut(); // UnMark |
| 3177 | } |
| 3178 | |
| 3179 | to.SetFlagCopied(); // Set the copied flag. |
| 3180 | return true; |
| 3181 | } |
| 3182 | |
| 3183 | bool cHardwareCPU::Inst_StackReadInst(cAvidaContext&) |
| 3184 | { |
nothing calls this directly
no test coverage detected