| 349 | } |
| 350 | |
| 351 | bool CMipsInstruction::Load(const char* Name, const char* Params, int RamPos) |
| 352 | { |
| 353 | bool paramfail = false; |
| 354 | NoCheckError = false; |
| 355 | this->RamPos = RamPos; |
| 356 | |
| 357 | const MipsArchDefinition& arch = mipsArchs[MARCH_PS2]; |
| 358 | for (int z = 0; MipsOpcodes[z].name != NULL; z++) |
| 359 | { |
| 360 | if ((MipsOpcodes[z].archs & arch.supportSets) == 0) |
| 361 | continue; |
| 362 | if ((MipsOpcodes[z].archs & arch.excludeMask) != 0) |
| 363 | continue; |
| 364 | |
| 365 | if ((MipsOpcodes[z].flags & MO_64BIT) && !(arch.flags & MO_64BIT)) |
| 366 | continue; |
| 367 | if ((MipsOpcodes[z].flags & MO_FPU) && !(arch.flags & MO_FPU)) |
| 368 | continue; |
| 369 | |
| 370 | if (parseOpcode(MipsOpcodes[z],Name)) |
| 371 | { |
| 372 | if (LoadEncoding(MipsOpcodes[z],Params)) |
| 373 | { |
| 374 | Loaded = true; |
| 375 | return true; |
| 376 | } |
| 377 | paramfail = true; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | if (!NoCheckError) |
| 382 | { |
| 383 | if (paramfail) |
| 384 | { |
| 385 | error = "Parameter failure."; |
| 386 | } else { |
| 387 | error = "Invalid opcode."; |
| 388 | } |
| 389 | } |
| 390 | return false; |
| 391 | } |
| 392 | |
| 393 | |
| 394 | bool CMipsInstruction::parseOpcode(const tMipsOpcode& SourceOpcode, const char* Line) |
no outgoing calls
no test coverage detected