about summary refs log blame commit diff stats
path: root/subx/017jump_disp8.cc
blob: b7bb9300c2a4fa4580f7bfa1c4c4f39ed203979f (plain) (tree)
1
2
3
4
5
6
7
8
9
                        


         

                                                   
 
                     
      
                                           
                                                                  



                                             
                      


                                   

                                           
                                                      


                


                       
                                   
                                                                                
 
                           
            
      



                                                                  

                      

                      
 

                                   
                                                 
           
                                                        




                  
                        
             
      



                                                                  
                      

                      



                               
                                   
                                                                                          
 
                            
             
      



                                                                  

                      

                      
 

                                    
                                                 
            
                                                        




                  
                         
            
      



                                                                  
                      

                      



                    
                                   
                                                                                                   
 
                           


             
      



                                                                  

                      

                      
 

                                         
                                                 
                        
                                                        




                  
                        


             
      



                                                                  
                      

                      



                             
                                   
                                                                                            
 
                            

             
      



                                                                  

                      

                      
 

                                   
                                                 
                 
                                                        




                  
                         

             
      



                                                                  
                      

                      



                   
                                   
                                                                                  
 
                           


             
      



                                                                  

                      

                      
 

                                        
                                                 
                 
                                                        




                  
                        


             
      



                                                                  
                      

                      



                            
                                   
                                                                                                        
 
                          


             
      



                                                                  

                      

                      
 
                           


             
      



                                                                  

                      

                      
 

                                      
                                                 
                       
                                                        




                  
                            


             
      



                                                                  
                      

                      
            
//: jump to 8-bit offset

//:: jump

:(before "End Initialize Op Names")
put_new(Name, "eb", "jump disp8 bytes away (jmp)");

:(scenario jump_rel8)
== 0x1
# op  ModR/M  SIB   displacement  immediate
  eb                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0xeb: {  // jump rel8
  int8_t offset = static_cast<int>(next());
  trace(90, "run") << "jump " << NUM(offset) << end();
  EIP += offset;
  break;
}

//:: jump if equal/zero

:(before "End Initialize Op Names")
put_new(Name, "74", "jump disp8 bytes away if equal, if ZF is set (jcc/jz/je)");

:(scenario je_rel8_success)
% ZF = true;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  74                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x74: {  // jump rel8 if ZF
  const int8_t offset = static_cast<int>(next());
  if (ZF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario je_rel8_fail)
% ZF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  74                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5

//:: jump if not equal/not zero

:(before "End Initialize Op Names")
put_new(Name, "75", "jump disp8 bytes away if not equal, if ZF is not set (jcc/jnz/jne)");

:(scenario jne_rel8_success)
% ZF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  75                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x75: {  // jump rel8 unless ZF
  const int8_t offset = static_cast<int>(next());
  if (!ZF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario jne_rel8_fail)
% ZF = true;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  75                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5

//:: jump if greater

:(before "End Initialize Op Names")
put_new(Name, "7f", "jump disp8 bytes away if greater, if ZF is unset and SF == OF (jcc/jg/jnle)");

:(scenario jg_rel8_success)
% ZF = false;
% SF = false;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7f                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x7f: {  // jump rel8 if !SF and !ZF
  const int8_t offset = static_cast<int>(next());
  if (!ZF && SF == OF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario jg_rel8_fail)
% ZF = false;
% SF = true;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7f                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5

//:: jump if greater or equal

:(before "End Initialize Op Names")
put_new(Name, "7d", "jump disp8 bytes away if greater or equal, if SF == OF (jcc/jge/jnl)");

:(scenario jge_rel8_success)
% SF = false;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7d                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x7d: {  // jump rel8 if !SF
  const int8_t offset = static_cast<int>(next());
  if (SF == OF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario jge_rel8_fail)
% SF = true;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7d                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5

//:: jump if lesser

:(before "End Initialize Op Names")
put_new(Name, "7c", "jump disp8 bytes away if lesser, if SF != OF (jcc/jl/jnge)");

:(scenario jl_rel8_success)
% ZF = false;
% SF = true;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7c                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x7c: {  // jump rel8 if SF and !ZF
  const int8_t offset = static_cast<int>(next());
  if (SF != OF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario jl_rel8_fail)
% ZF = false;
% SF = false;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7c                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5

//:: jump if lesser or equal

:(before "End Initialize Op Names")
put_new(Name, "7e", "jump disp8 bytes away if lesser or equal, if ZF is set or SF != OF (jcc/jle/jng)");

:(scenario jle_rel8_equal)
% ZF = true;
% SF = false;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7e                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(scenario jle_rel8_lesser)
% ZF = false;
% SF = true;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7e                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: jump 5
+run: inst: 0x00000008
-run: inst: 0x00000003

:(before "End Single-Byte Opcodes")
case 0x7e: {  // jump rel8 if SF or ZF
  const int8_t offset = static_cast<int>(next());
  if (ZF || SF != OF) {
    trace(90, "run") << "jump " << NUM(offset) << end();
    EIP += offset;
  }
  break;
}

:(scenario jle_rel8_greater)
% ZF = false;
% SF = false;
% OF = false;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  7e                05                        # skip 1 instruction
  05                              00 00 00 01
  05                              00 00 00 02
+run: inst: 0x00000001
+run: inst: 0x00000003
+run: inst: 0x00000008
-run: jump 5
span>src/otr/otr.h src/otr/otr.c omemo_sources = \ src/omemo/omemo.h src/omemo/omemo.c src/omemo/crypto.h src/omemo/crypto.c \ src/omemo/store.h src/omemo/store.c src/xmpp/omemo.h src/xmpp/omemo.c omemo_unittest_sources = \ tests/unittests/omemo/stub_omemo.c if BUILD_PYTHON_API core_sources += $(python_sources) unittest_sources += $(python_sources) endif if BUILD_C_API core_sources += $(c_sources) unittest_sources += $(c_sources) endif otr_unittest_sources = \ tests/unittests/otr/stub_otr.c themes_sources = $(top_srcdir)/themes/* icons_sources = $(top_srcdir)/icons/* script_sources = bootstrap.sh man_sources = docs/profanity.1 if BUILD_PGP core_sources += $(pgp_sources) unittest_sources += $(pgp_unittest_sources) endif if BUILD_OTR unittest_sources += $(otr_unittest_sources) if BUILD_OTR3 core_sources += $(otr3_sources) endif if BUILD_OTR4 core_sources += $(otr4_sources) endif endif if BUILD_OMEMO core_sources += $(omemo_sources) unittest_sources += $(omemo_unittest_sources) endif AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src bin_PROGRAMS = profanity profanity_SOURCES = $(core_sources) $(main_source) if THEMES_INSTALL profanity_themesdir = @THEMES_PATH@ profanity_themes_DATA = $(themes_sources) endif if INCLUDE_GIT_VERSION BUILT_SOURCES = $(git_include) endif profanity_iconsdir = @ICONS_PATH@ profanity_icons_DATA = $(icons_sources) if BUILD_C_API lib_LTLIBRARIES = libprofanity.la libprofanity_la_LDFLAGS = -version-info 0:0:0 -shared -no-undefined libprofanity_la_SOURCES = src/plugins/profapi.c library_includedir=$(includedir) library_include_HEADERS = src/plugins/profapi.h endif TESTS = tests/unittests/unittests check_PROGRAMS = tests/unittests/unittests tests_unittests_unittests_SOURCES = $(unittest_sources) tests_unittests_unittests_LDADD = -lcmocka # Functional test were commented out because of: # https://github.com/profanity-im/profanity/pull/1010 # An issue was raised for stabber: # https://github.com/profanity-im/stabber/issues/5 # Once this issue is resolved functional tests should be enabled again # #if HAVE_STABBER #if HAVE_EXPECT #TESTS += tests/functionaltests/functionaltests #check_PROGRAMS += tests/functionaltests/functionaltests #tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources) #tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5 #tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect -ltcl #endif #endif man_MANS = $(man_sources) EXTRA_DIST = $(man_sources) $(icons_sources) $(themes_sources) $(script_sources) profrc.example theme_template LICENSE.txt README.md CHANGELOG # Ship API documentation with `make dist` EXTRA_DIST += \ apidocs/c/c-prof.conf \ apidocs/c/gen.sh \ apidocs/c/profapi.h \ apidocs/c/profhooks.h \ apidocs/python/conf.py \ apidocs/python/gen.sh \ apidocs/python/index.rst \ apidocs/python/Makefile \ apidocs/python/src/plugin.py \ apidocs/python/src/prof.py if INCLUDE_GIT_VERSION EXTRA_DIST += .git/HEAD .git/index $(git_include).in: .git/HEAD .git/index rm -f $@ echo "#ifndef PROF_GIT_BRANCH" >> $@ echo "#define PROF_GIT_BRANCH \"$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)\"" >> $@ echo "#endif" >> $@ echo "#ifndef PROF_GIT_REVISION" >> $@ echo "#define PROF_GIT_REVISION \"$(shell git log --pretty=format:'%h' -n 1)\"" >> $@ echo "#endif" >> $@ # # Create $(git_include) atomically to catch possible race. The race can occur # when $(git_include) is generated in parallel with building of src/profanity.c. # So this hack allows to find and fix the problem earlier. # $(git_include): $(git_include).in cp $< $@ clean-local: rm -f $(git_include) $(git_include).in endif check-unit: tests/unittests/unittests tests/unittests/unittests