• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
          • Dynamic-instrumentation
          • Initialize-x86-state
          • Binary-file-load-fn
          • Read-channel-into-memory
          • Setting-up-page-tables
          • Read-channel-into-byte-list
          • Init-zero-page
          • Linux-load
          • Read-file-into-memory
          • Read-file-into-byte-list
          • Init-sys-view
          • Load-elf-sections
          • Chars-to-c-str
          • String-to-c-str
          • Pack-u64
          • Pack-u32
          • Concrete-simulation-examples
            • Fibonacci32-cosim
            • Fibonacci-cosim
            • Factorial-cosim
            • Nop-cosim
              • Check-xchg-output
                • Check-nop-output
              • Datacopy-cosim
            • Gdt-entry
          • Sdm-instruction-set-summary
          • Tlb
          • Running-linux
          • Introduction
          • Asmtest
          • X86isa-build-instructions
          • Publications
          • Contributors
          • Machine
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
            • Fibonacci32-cosim
            • Fibonacci-cosim
            • Factorial-cosim
            • Nop-cosim
              • Check-xchg-output
                • Check-nop-output
              • Datacopy-cosim
            • Utils
            • Debugging-code-proofs
          • Axe
          • Execloader
        • Math
        • Testing-utilities
      • Nop-cosim

      Check-xchg-output

      Signature
      (check-xchg-output halt-address x86) → *
      Arguments
      x86 — Output x86 State.

      Definitions and Theorems

      Function: check-xchg-output

      (defun check-xchg-output (halt-address x86)
       (declare (xargs :stobjs (x86)))
       (declare (type (signed-byte 48) halt-address))
       (let ((__function__ 'check-xchg-output))
        (declare (ignorable __function__))
        (cond
         ((or
            (fault x86)
            (not (equal (ms x86)
                        (cons (cons 'x86-fetch-decode-execute-halt
                                    (cons ':rip (cons halt-address 'nil)))
                              'nil))))
          (cw "~|(ms x86) = ~x0 (fault x86) = ~x1~%"
              (ms x86)
              (fault x86)))
         (t (if (and (equal (rgfi *rax* x86) 65535)
                     (equal (rgfi *rbx* x86) 0)
                     (equal (rgfi *rcx* x86) 0)
                     (equal (rgfi *rdx* x86) 0)
                     (equal (rgfi *rsi* x86) 0)
                     (equal (rgfi *rdi* x86) 0)
                     (equal (rgfi *rsp* x86) 0)
                     (equal (rgfi *r8* x86) 4294901761)
                     (equal (rgfi *r9* x86) 0)
                     (equal (rgfi *r10* x86) 0)
                     (equal (rgfi *r11* x86) 0)
                     (equal (rgfi *r12* x86) 0)
                     (equal (rgfi *r13* x86) 0)
                     (equal (rgfi *r14* x86) 0)
                     (equal (rgfi *r15* x86) 0)
                     (equal (rflags x86) 2))
                (prog2$ (cw "~|XCHG behaves as expected.~%")
                        t)
              (cw "~|XCHG DOES NOT behave as expected!~%"))))))