| 8436 | } |
| 8437 | |
| 8438 | void testCallFarE32() { |
| 8439 | cpu->big = true; |
| 8440 | U8 rm = (3 << 3); |
| 8441 | rm += 5; |
| 8442 | |
| 8443 | newInstructionWithRM(0xff, rm, 0); |
| 8444 | pushCode32(200); |
| 8445 | |
| 8446 | pushCode8(0xcd); |
| 8447 | pushCode8(0xcd); |
| 8448 | |
| 8449 | cseip = CODE_ADDRESS + 0x128; |
| 8450 | |
| 8451 | EAX = 0; |
| 8452 | |
| 8453 | // add ax, 0x10 |
| 8454 | pushCode8(0x83); |
| 8455 | pushCode8(0xc0); |
| 8456 | pushCode8(0x10); |
| 8457 | |
| 8458 | U32 esp = ESP; |
| 8459 | |
| 8460 | memory->writed(cpu->seg[DS].address + 200, 0x128); |
| 8461 | memory->writed(cpu->seg[DS].address + 204, CODE_SEG_16); |
| 8462 | |
| 8463 | runTestCPU(); |
| 8464 | |
| 8465 | assertTrue(AX == 0x10); |
| 8466 | assertTrue(memory->readd(cpu->seg[SS].address + esp - 4) == CODE_SEG); |
| 8467 | assertTrue(memory->readd(cpu->seg[SS].address + esp - 8) == 6); |
| 8468 | assertTrue(SP == 4088); |
| 8469 | assertTrue(cpu->big == false); |
| 8470 | cpu->big = true; |
| 8471 | setup();// re-init segs for next unit test |
| 8472 | } |
| 8473 | |
| 8474 | void testJmpE16() { |
| 8475 | for (int i = 0; i < 8; i++) { |
no test coverage detected