13
| 1315 | |
| 1316 | //13 |
| 1317 | bool cHardwareTransSMT::Inst_Val_Mod(cAvidaContext&) |
| 1318 | { |
| 1319 | const int dst = FindModifiedStack(STACK_BX); |
| 1320 | const int op1 = FindModifiedStack(STACK_BX); |
| 1321 | const int op2 = FindModifiedNextStack(op1); |
| 1322 | if (Stack(op2).Top() != 0) { |
| 1323 | if(Stack(op2).Top() == -1) |
| 1324 | Stack(dst).Push(0); |
| 1325 | else |
| 1326 | Stack(dst).Push(Stack(op1).Top() % Stack(op2).Top()); |
| 1327 | } else { |
| 1328 | m_organism->Fault(FAULT_LOC_MATH, FAULT_TYPE_ERROR, "mod: modding by 0"); |
| 1329 | return false; |
| 1330 | } |
| 1331 | return true; |
| 1332 | } |
| 1333 | |
| 1334 | //14 |
| 1335 | bool cHardwareTransSMT::Inst_Val_Inc(cAvidaContext&) |