MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / EbAlAx

Function EbAlAx

source/test/testCPU.cpp:423–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423void EbAlAx(int instruction, int which, struct Data* data, int useAX) {
424 while (data->valid) {
425 int eb;
426 int rm;
427
428 for (eb = 0; eb < 8; eb++) {
429 U8* reg;
430
431 if (eb == 0 || eb == 4)
432 continue;
433
434 rm = eb | (which << 3) | 0xC0;
435 reg = cpu->reg8[E(rm)];
436 newInstructionWithRM(instruction, rm, data->flags);
437 cpu->reg[E8(rm)].u32 = DEFAULT;
438 EAX = DEFAULT;
439 *reg = (U8)data->var2;
440 if (useAX)
441 AX = data->var1;
442 else
443 AL = data->var1;
444 runTestCPU();
445 assertResult(data, cpu, instruction, AX, 0, 0, -1, 0, 8);
446
447 newInstructionWithRM(instruction, rm, data->flags);
448 cpu->reg[E8(rm)].u32 = DEFAULT;
449 EAX = DEFAULT;
450 *reg = (U8)data->var2;
451 if (useAX)
452 AX = data->var1;
453 else
454 AL = data->var1;
455 pushCode8(0x39);
456 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
457 runTestCPU();
458 assertResult(data, cpu, instruction, AX, 0, 0, -1, 0, 8, true);
459 }
460
461 rm = (which << 3);
462 if (cpu->big)
463 rm += 5;
464 else
465 rm += 6;
466 newInstructionWithRM(instruction, rm, data->flags);
467 if (cpu->big)
468 pushCode32(200);
469 else
470 pushCode16(200);
471 EAX = DEFAULT;
472 if (useAX)
473 AX = data->var1;
474 else
475 AL = data->var1;
476 memory->writed(cpu->seg[DS].address + 200, DEFAULT);
477 memory->writeb(cpu->seg[DS].address + 200, data->var2);
478 runTestCPU();
479 assertResult(data, cpu, instruction, AX, 0, 0, -1, 0, 16);
480

Callers 2

testGrp30x0f6Function · 0.85
testGrp30x2f6Function · 0.85

Calls 8

newInstructionWithRMFunction · 0.85
runTestCPUFunction · 0.85
assertResultFunction · 0.85
pushCode8Function · 0.85
pushCode32Function · 0.85
pushCode16Function · 0.85
writedMethod · 0.45
writebMethod · 0.45

Tested by

no test coverage detected