• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • 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
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
      • Bigmems
      • Builtins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • 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.