• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
            • Read-operands-and-write-results
            • Effective-address-computations
            • Select-operand-size
            • Instruction-pointer-operations
            • Stack-pointer-operations
            • Select-segment-register
            • Prefix-modrm-sib-decoding
            • Select-address-size
            • Rex-byte-from-vex-prefixes
            • Check-instruction-length
            • Error-objects
            • Rip-guard-okp
            • Sib-decoding
              • Sib-structures
              • X86-decode-sib-p
          • Instructions
          • Register-readers-and-writers
          • X86-modes
          • Segmentation
          • Other-non-deterministic-computations
          • Environment
          • Paging
        • Implemented-opcodes
        • To-do
        • Proof-utilities
        • Peripherals
        • Model-validation
        • Modelcalls
        • Concrete-simulation-examples
        • Utils
        • Debugging-code-proofs
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Decoding-and-spec-utils

Sib-decoding

Functions to detect and decode SIB bytes

Definitions and Theorems

Function: x86-decode-sib-p

(defun x86-decode-sib-p (modr/m 16-bit-addressp)
  (declare (type (unsigned-byte 8) modr/m))
  (declare (xargs :guard (booleanp 16-bit-addressp)))
  (let ((__function__ 'x86-decode-sib-p))
    (declare (ignorable __function__))
    (and (not 16-bit-addressp)
         (b* ((r/m (modr/m->r/m modr/m))
              (mod (modr/m->mod modr/m)))
           (and (int= r/m 4)
                (not (int= mod 3)))))))

Theorem: booleanp-of-x86-decode-sib-p

(defthm booleanp-of-x86-decode-sib-p
  (implies (n08p modr/m)
           (b* ((bool (x86-decode-sib-p modr/m 16-bit-addressp)))
             (booleanp bool)))
  :rule-classes :rewrite)

Subtopics

Sib-structures
Bitstruct definitions to store a SIB byte and its fields.
X86-decode-sib-p
Returns a boolean saying whether a SIB byte is expected to follow a ModR/M byte or not.