| 500 | } |
| 501 | |
| 502 | void EwAxDx(int instruction, int which, struct Data* data, int useDX) { |
| 503 | while (data->valid) { |
| 504 | int rm; |
| 505 | int ew; |
| 506 | |
| 507 | for (ew = 0; ew < 8; ew++) { |
| 508 | Reg* reg; |
| 509 | |
| 510 | if (ew == 0) |
| 511 | continue; |
| 512 | if (useDX && ew == 2) |
| 513 | continue; |
| 514 | rm = ew | (which << 3) | 0xC0; |
| 515 | newInstructionWithRM(instruction, rm, data->flags); |
| 516 | reg = &cpu->reg[E(rm)]; |
| 517 | EAX = DEFAULT; |
| 518 | EDX = DEFAULT; |
| 519 | reg->u32 = DEFAULT; |
| 520 | AX = data->var2; |
| 521 | DX = data->var1; |
| 522 | reg->u16 = data->constant; |
| 523 | runTestCPU(); |
| 524 | assertResult(data, cpu, instruction, AX, DX, 0, 2, 0, 16); |
| 525 | |
| 526 | if (ew == 4) { |
| 527 | continue; |
| 528 | } |
| 529 | newInstructionWithRM(instruction, rm, data->flags); |
| 530 | reg = &cpu->reg[E(rm)]; |
| 531 | EAX = DEFAULT; |
| 532 | EDX = DEFAULT; |
| 533 | reg->u32 = DEFAULT; |
| 534 | AX = data->var2; |
| 535 | DX = data->var1; |
| 536 | reg->u16 = data->constant; |
| 537 | pushCode8(0x39); |
| 538 | pushCode8(0xc0); // cmp eax, eax: this will overwrite flags so the above code might take a different path in the dynamic cores that optimize away flag calculation |
| 539 | runTestCPU(); |
| 540 | assertResult(data, cpu, instruction, AX, DX, 0, 2, 0, 16, true); |
| 541 | } |
| 542 | |
| 543 | rm = (which << 3); |
| 544 | if (cpu->big) |
| 545 | rm += 5; |
| 546 | else |
| 547 | rm += 6; |
| 548 | newInstructionWithRM(instruction, rm, data->flags); |
| 549 | if (cpu->big) |
| 550 | pushCode32(200); |
| 551 | else |
| 552 | pushCode16(200); |
| 553 | EAX = DEFAULT; |
| 554 | EDX = DEFAULT; |
| 555 | AX = data->var2; |
| 556 | DX = data->var1; |
| 557 | memory->writed(cpu->seg[DS].address + 200, DEFAULT); |
| 558 | memory->writew(cpu->seg[DS].address + 200, data->constant); |
| 559 | runTestCPU(); |
no test coverage detected