diff options
Diffstat (limited to 'linux/bootstrap')
-rw-r--r-- | linux/bootstrap/017jump_disp8.cc | 24 | ||||
-rw-r--r-- | linux/bootstrap/018jump_disp32.cc | 24 |
2 files changed, 48 insertions, 0 deletions
diff --git a/linux/bootstrap/017jump_disp8.cc b/linux/bootstrap/017jump_disp8.cc index 30e60a74..37df6d5b 100644 --- a/linux/bootstrap/017jump_disp8.cc +++ b/linux/bootstrap/017jump_disp8.cc @@ -405,3 +405,27 @@ void test_jle_disp8_greater() { ); CHECK_TRACE_DOESNT_CONTAIN("run: jump 5"); } + +//:: jump if overflow + +:(before "End Initialize Op Names") +put_new(Name, "70", "jump disp8 bytes away if OF is set (jcc/jo)"); +put_new(Name, "71", "jump disp8 bytes away if OF is unset (jcc/jno)"); + +:(before "End Single-Byte Opcodes") +case 0x70: { // jump disp8 if OF is set + const int8_t offset = static_cast<int>(next()); + if (OF) { + trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); + EIP += offset; + } + break; +} +case 0x71: { // jump disp8 if OF is unset + const int8_t offset = static_cast<int>(next()); + if (!OF) { + trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); + EIP += offset; + } + break; +} diff --git a/linux/bootstrap/018jump_disp32.cc b/linux/bootstrap/018jump_disp32.cc index e77bc584..75fb576a 100644 --- a/linux/bootstrap/018jump_disp32.cc +++ b/linux/bootstrap/018jump_disp32.cc @@ -405,3 +405,27 @@ void test_jle_disp32_greater() { ); CHECK_TRACE_DOESNT_CONTAIN("run: jump 5"); } + +//:: jump if overflow + +:(before "End Initialize Op Names") +put_new(Name_0f, "80", "jump disp32 bytes away if OF is set (jcc/jo)"); +put_new(Name_0f, "81", "jump disp32 bytes away if OF is unset (jcc/jno)"); + +:(before "End Two-Byte Opcodes Starting With 0f") +case 0x80: { // jump disp8 if OF is set + const int32_t offset = next32(); + if (OF) { + trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); + EIP += offset; + } + break; +} +case 0x81: { // jump disp8 if OF is unset + const int32_t offset = next32(); + if (!OF) { + trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); + EIP += offset; + } + break; +} |