| 1456 | } |
| 1457 | |
| 1458 | void GbEd(int instruction, struct Data* data) { |
| 1459 | while (data->valid) { |
| 1460 | int ew; |
| 1461 | int gw; |
| 1462 | int rm; |
| 1463 | |
| 1464 | for (ew = 0; ew < 8; ew++) { |
| 1465 | for (gw = 0; gw < 8; gw++) { |
| 1466 | Reg* e; |
| 1467 | Reg* g; |
| 1468 | U8* g8; |
| 1469 | |
| 1470 | if (gw == 4) { |
| 1471 | continue; // x64 doesn't code for the valid test |
| 1472 | } |
| 1473 | rm = ew | (gw << 3) | 0xC0; |
| 1474 | newInstructionWithRM(instruction, rm, data->flags); |
| 1475 | pushConstant(data); |
| 1476 | e = &cpu->reg[G(rm)]; |
| 1477 | g = &cpu->reg[E(rm)]; |
| 1478 | g8 = cpu->reg8[E(rm)]; |
| 1479 | |
| 1480 | g->u32 = DEFAULT; |
| 1481 | e->u32 = data->var1; |
| 1482 | *g8 = data->var2; |
| 1483 | runTestCPU(); |
| 1484 | assertResult(data, cpu, instruction, e->u32, g->u32, E(rm), G(rm), 0, 32); |
| 1485 | } |
| 1486 | } |
| 1487 | |
| 1488 | for (gw = 0; gw < 8; gw++) { |
| 1489 | Reg* g; |
| 1490 | |
| 1491 | rm = (gw << 3); |
| 1492 | if (cpu->big) |
| 1493 | rm += 5; |
| 1494 | else |
| 1495 | rm += 6; |
| 1496 | newInstructionWithRM(instruction, rm, data->flags); |
| 1497 | if (cpu->big) |
| 1498 | pushCode32(200); |
| 1499 | else |
| 1500 | pushCode16(200); |
| 1501 | pushConstant(data); |
| 1502 | memory->writed(cpu->seg[DS].address + 200, DEFAULT); |
| 1503 | memory->writeb(cpu->seg[DS].address + 200, data->var2); |
| 1504 | g = &cpu->reg[G(rm)]; |
| 1505 | g->u32 = data->var1; |
| 1506 | runTestCPU(); |
| 1507 | assertResult(data, cpu, instruction, g->u32, 0, G(rm), -1, cpu->seg[DS].address + 200, 32); |
| 1508 | } |
| 1509 | data++; |
| 1510 | } |
| 1511 | } |
| 1512 | |
| 1513 | void GwEd(int instruction, struct Data* data) { |
| 1514 | while (data->valid) { |
no test coverage detected