diff options
-rw-r--r-- | subx/017jump_disp8.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/subx/017jump_disp8.cc b/subx/017jump_disp8.cc index 086765c0..d7558401 100644 --- a/subx/017jump_disp8.cc +++ b/subx/017jump_disp8.cc @@ -6,7 +6,7 @@ put_new(Name, "eb", "jump disp8 bytes away (jmp)"); :(code) -void test_jump_rel8() { +void test_jump_disp8() { run( "== code 0x1\n" // op ModR/M SIB displacement immediate @@ -23,7 +23,7 @@ void test_jump_rel8() { } :(before "End Single-Byte Opcodes") -case 0xeb: { // jump rel8 +case 0xeb: { // jump disp8 int8_t offset = static_cast<int>(next()); trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); EIP += offset; @@ -36,7 +36,7 @@ case 0xeb: { // jump rel8 put_new(Name, "74", "jump disp8 bytes away if equal, if ZF is set (jcc/jz/je)"); :(code) -void test_je_rel8_success() { +void test_je_disp8_success() { ZF = true; run( "== code 0x1\n" @@ -54,7 +54,7 @@ void test_je_rel8_success() { } :(before "End Single-Byte Opcodes") -case 0x74: { // jump rel8 if ZF +case 0x74: { // jump disp8 if ZF const int8_t offset = static_cast<int>(next()); if (ZF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -64,7 +64,7 @@ case 0x74: { // jump rel8 if ZF } :(code) -void test_je_rel8_fail() { +void test_je_disp8_fail() { ZF = false; run( "== code 0x1\n" @@ -87,7 +87,7 @@ void test_je_rel8_fail() { put_new(Name, "75", "jump disp8 bytes away if not equal, if ZF is not set (jcc/jnz/jne)"); :(code) -void test_jne_rel8_success() { +void test_jne_disp8_success() { ZF = false; run( "== code 0x1\n" @@ -105,7 +105,7 @@ void test_jne_rel8_success() { } :(before "End Single-Byte Opcodes") -case 0x75: { // jump rel8 unless ZF +case 0x75: { // jump disp8 unless ZF const int8_t offset = static_cast<int>(next()); if (!ZF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -115,7 +115,7 @@ case 0x75: { // jump rel8 unless ZF } :(code) -void test_jne_rel8_fail() { +void test_jne_disp8_fail() { ZF = true; run( "== code 0x1\n" @@ -139,7 +139,7 @@ put_new(Name, "7f", "jump disp8 bytes away if greater (signed), if ZF is unset a put_new(Name, "77", "jump disp8 bytes away if greater (unsigned), if ZF is unset and CF is unset (jcc/ja/jnbe)"); :(code) -void test_jg_rel8_success() { +void test_jg_disp8_success() { ZF = false; SF = false; OF = false; @@ -159,7 +159,7 @@ void test_jg_rel8_success() { } :(before "End Single-Byte Opcodes") -case 0x7f: { // jump rel8 if SF == OF and !ZF +case 0x7f: { // jump disp8 if SF == OF and !ZF const int8_t offset = static_cast<int>(next()); if (SF == OF && !ZF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -167,7 +167,7 @@ case 0x7f: { // jump rel8 if SF == OF and !ZF } break; } -case 0x77: { // jump rel8 if !CF and !ZF +case 0x77: { // jump disp8 if !CF and !ZF const int8_t offset = static_cast<int>(next()); if (!CF && !ZF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -177,7 +177,7 @@ case 0x77: { // jump rel8 if !CF and !ZF } :(code) -void test_jg_rel8_fail() { +void test_jg_disp8_fail() { ZF = false; SF = true; OF = false; @@ -203,7 +203,7 @@ put_new(Name, "7d", "jump disp8 bytes away if greater or equal (signed), if SF = put_new(Name, "73", "jump disp8 bytes away if greater or equal (unsigned), if CF is unset (jcc/jae/jnb)"); :(code) -void test_jge_rel8_success() { +void test_jge_disp8_success() { SF = false; OF = false; run( @@ -222,7 +222,7 @@ void test_jge_rel8_success() { } :(before "End Single-Byte Opcodes") -case 0x7d: { // jump rel8 if SF == OF +case 0x7d: { // jump disp8 if SF == OF const int8_t offset = static_cast<int>(next()); if (SF == OF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -230,7 +230,7 @@ case 0x7d: { // jump rel8 if SF == OF } break; } -case 0x73: { // jump rel8 if !CF +case 0x73: { // jump disp8 if !CF const int8_t offset = static_cast<int>(next()); if (!CF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -240,7 +240,7 @@ case 0x73: { // jump rel8 if !CF } :(code) -void test_jge_rel8_fail() { +void test_jge_disp8_fail() { SF = true; OF = false; run( @@ -265,7 +265,7 @@ put_new(Name, "7c", "jump disp8 bytes away if lesser (signed), if SF != OF (jcc/ put_new(Name, "72", "jump disp8 bytes away if lesser (unsigned), if CF is set (jcc/jb/jnae)"); :(code) -void test_jl_rel8_success() { +void test_jl_disp8_success() { ZF = false; SF = true; OF = false; @@ -285,7 +285,7 @@ void test_jl_rel8_success() { } :(before "End Single-Byte Opcodes") -case 0x7c: { // jump rel8 if SF != OF +case 0x7c: { // jump disp8 if SF != OF const int8_t offset = static_cast<int>(next()); if (SF != OF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -293,7 +293,7 @@ case 0x7c: { // jump rel8 if SF != OF } break; } -case 0x72: { // jump rel8 if CF +case 0x72: { // jump disp8 if CF const int8_t offset = static_cast<int>(next()); if (CF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -303,7 +303,7 @@ case 0x72: { // jump rel8 if CF } :(code) -void test_jl_rel8_fail() { +void test_jl_disp8_fail() { ZF = false; SF = false; OF = false; @@ -329,7 +329,7 @@ put_new(Name, "7e", "jump disp8 bytes away if lesser or equal (signed), if ZF is put_new(Name, "76", "jump disp8 bytes away if lesser or equal (unsigned), if ZF is set or CF is set (jcc/jbe/jna)"); :(code) -void test_jle_rel8_equal() { +void test_jle_disp8_equal() { ZF = true; SF = false; OF = false; @@ -349,7 +349,7 @@ void test_jle_rel8_equal() { } :(code) -void test_jle_rel8_lesser() { +void test_jle_disp8_lesser() { ZF = false; SF = true; OF = false; @@ -369,7 +369,7 @@ void test_jle_rel8_lesser() { } :(before "End Single-Byte Opcodes") -case 0x7e: { // jump rel8 if ZF or SF != OF +case 0x7e: { // jump disp8 if ZF or SF != OF const int8_t offset = static_cast<int>(next()); if (ZF || SF != OF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -377,7 +377,7 @@ case 0x7e: { // jump rel8 if ZF or SF != OF } break; } -case 0x76: { // jump rel8 if ZF or CF +case 0x76: { // jump disp8 if ZF or CF const int8_t offset = static_cast<int>(next()); if (ZF || CF) { trace(Callstack_depth+1, "run") << "jump " << NUM(offset) << end(); @@ -387,7 +387,7 @@ case 0x76: { // jump rel8 if ZF or CF } :(code) -void test_jle_rel8_greater() { +void test_jle_disp8_greater() { ZF = false; SF = false; OF = false; |