Instruction Semantic Functions
The instruction semantic functions have dual roles:
- They fetch the instruction's operands, as dictated by the decoded
components of the instruction (like the prefixes, SIB byte, etc.)
provided as input; these decoded components are provided by our x86
decoder function x86-fetch-decode-execute.
- They contain or act as the functional specification of the
instructions. For example, the functional specification function of
the ADD instruction returns two values: the appropriately truncated
sum of the operands and the modified flags. We do not deal with the
x86 state in these specifications.
Each semantic function takes, among other arguments, the value
start-rip of the instruction pointer at the beginning of the
instruction, and the value temp-rip of the instruction pointer
after the decoding of the prefixes, REX byte, opcode, ModR/M byte, and
SIB byte (some of these bytes may not be present). The semantic
function may further increment the instruction pointer beyond
temp-rip to read the ending bytes of the instruction, e.g. to
read a displacement or an immediate. The semantic function eventually
writes the final value of the instruction pointer into RIP.
- Specification for the SAR instruction
- Specification for the SHR instruction
- Specification for the SAL/SHL instruction
- Specification for the ROL instruction
- Specification for the ROR instruction
- Specification for the RCL instruction
- Specification for the RCR instruction
- Specification for the IMUL (unsigned imultiply) instruction
- Specification for the MUL (unsigned multiply) instruction
- Specification for the IDIV (unsigned idivide) instruction
- Specification for the DIV (unsigned divide) instruction
- Specification for the SHRD instruction.
- Specification for the SHLD instruction.
- Semantics of general-purpose arithmetic and logical instructions
- Misc. utilities for the specification of floating-point operations