0

I want to write a parser for Intel x86 assembly, say NASM, to break the instructions up into basic blocks.

In order to do this correctly, I need to know all control flow instructions.

I am well aware of all the jmp, jne, jle, etc. instructions, but are there others beside those “common” ones?

Shuzheng
  • 11,288
  • 20
  • 88
  • 186
  • But I know I can look the whole Intel Reference through. But maybe someone had already compiled a list of control flow instructions. – Shuzheng Jun 14 '18 at 12:07
  • Are you including instructions that intentionally fault, transferring control to the OS via an interrupt vector (and potentially back to a user-space signal handler?) If so, there are a *lot* of ways you can get different instructions to fault. An invalid-instruction trap was the fastest way to make a system call on 386 (but isn't anymore); and was actually used by a few OSes. See [OsDev syscall/sysret and sysenter/sysexit instructions enabling](https://stackoverflow.com/q/46022184). – Peter Cordes Jun 14 '18 at 12:33
  • No, just instruction that jumps to a different location within the program. – Shuzheng Jun 14 '18 at 12:34
  • rtfm https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4 – sivizius Jun 16 '18 at 11:55

0 Answers0