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

Function doTestSet

source/test/testCPU.cpp:9775–9810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9773}
9774
9775void doTestSet(U32 instruction, U32 value1, U32 value2, bool isSet) {
9776 for (U32 ed = 0; ed < 8; ed++) {
9777 Reg* e;
9778
9779 U8 rm = ed | 0xC0;
9780
9781 // cmp ed, value2
9782 newInstructionWithRM(0x81, 0xf8 | (ed % 4), 0);
9783 if (cpu->big) {
9784 pushCode32(value2);
9785 } else {
9786 pushCode16(value2);
9787 }
9788 pushCode8(0x0F);
9789 pushCode8(instruction & 0xFF);
9790 pushCode8(rm);
9791
9792 e = &cpu->reg[ed % 4];
9793 e->u32 = value1;
9794 runTestCPU();
9795
9796 if (isSet) {
9797 if (ed > 3) {
9798 assertTrue(e->u32 == ((value1 & 0xffff00ff) | 0x00000100));
9799 } else {
9800 assertTrue(e->u32 == ((value1 & 0xffffff00) | 0x00000001));
9801 }
9802 } else {
9803 if (ed > 3) {
9804 assertTrue(e->u32 == (value1 & 0xffff00ff));
9805 } else {
9806 assertTrue(e->u32 == (value1 & 0xffffff00));
9807 }
9808 }
9809 }
9810}
9811
9812void doTestSet(U32 instruction, bool isNotFlag, U32 flags, U32 cmpValueThatTriggersFlag, U32 cmpValueThatDoesNotTriggerFlag) {
9813 for (U32 setFlags = 0; setFlags < 3; setFlags++) {

Callers 15

testSetO0x190Function · 0.85
testSetO0x390Function · 0.85
testSetNO0x191Function · 0.85
testSetNO0x391Function · 0.85
testSetB0x192Function · 0.85
testSetB0x392Function · 0.85
testSetNB0x193Function · 0.85
testSetNB0x393Function · 0.85
testSetZ0x194Function · 0.85
testSetZ0x394Function · 0.85
testSetNZ0x195Function · 0.85
testSetNZ0x395Function · 0.85

Calls 8

newInstructionWithRMFunction · 0.85
pushCode32Function · 0.85
pushCode16Function · 0.85
pushCode8Function · 0.85
runTestCPUFunction · 0.85
assertTrueFunction · 0.85
writedMethod · 0.45
readdMethod · 0.45

Tested by

no test coverage detected