| 580 | } |
| 581 | |
| 582 | void EdEaxEdx(int instruction, int which, struct Data* data, int useEdx) { |
| 583 | while (data->valid) { |
| 584 | int ed; |
| 585 | int rm; |
| 586 | |
| 587 | for (ed = 0; ed < 8; ed++) { |
| 588 | Reg* reg; |
| 589 | |
| 590 | if (ed == 0) |
| 591 | continue; |
| 592 | if (useEdx && ed == 2) |
| 593 | continue; |
| 594 | rm = ed | (which << 3) | 0xC0; |
| 595 | newInstructionWithRM(instruction, rm, data->flags); |
| 596 | reg = &cpu->reg[E(rm)]; |
| 597 | reg->u32 = DEFAULT; |
| 598 | EAX = data->var2; |
| 599 | EDX = data->var1; |
| 600 | reg->u32 = data->constant; |
| 601 | runTestCPU(); |
| 602 | assertResult(data, cpu, instruction, EAX, EDX, 0, 2, 0, 32); |
| 603 | |
| 604 | if (ed == 4) { |
| 605 | continue; |
| 606 | } |
| 607 | newInstructionWithRM(instruction, rm, data->flags); |
| 608 | reg = &cpu->reg[E(rm)]; |
| 609 | reg->u32 = DEFAULT; |
| 610 | EAX = data->var2; |
| 611 | EDX = data->var1; |
| 612 | reg->u32 = data->constant; |
| 613 | pushCode8(0x39); |
| 614 | 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 |
| 615 | runTestCPU(); |
| 616 | assertResult(data, cpu, instruction, EAX, EDX, 0, 2, 0, 32, true); |
| 617 | } |
| 618 | |
| 619 | rm = (which << 3); |
| 620 | if (cpu->big) |
| 621 | rm += 5; |
| 622 | else |
| 623 | rm += 6; |
| 624 | newInstructionWithRM(instruction, rm, data->flags); |
| 625 | if (cpu->big) |
| 626 | pushCode32(200); |
| 627 | else |
| 628 | pushCode16(200); |
| 629 | EAX = data->var2; |
| 630 | EDX = data->var1; |
| 631 | memory->writed(cpu->seg[DS].address + 200, DEFAULT); |
| 632 | memory->writed(cpu->seg[DS].address + 200, data->constant); |
| 633 | runTestCPU(); |
| 634 | assertResult(data, cpu, instruction, EAX, EDX, 0, 2, 0, 32); |
| 635 | |
| 636 | newInstructionWithRM(instruction, rm, data->flags); |
| 637 | if (cpu->big) |
| 638 | pushCode32(200); |
| 639 | else |
no test coverage detected