• 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
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
            • X86isa-state-history
            • Environment-field
            • Physical-memory-model
            • Save-restore
              • Restore-x86
                • Save-x86
            • Syscalls
            • Cpuid
            • Linear-memory
            • Rflag-specifications
            • Characterizing-undefined-behavior
            • Top-level-memory
            • App-view
            • X86-decoder
            • Physical-memory
            • Decoding-and-spec-utils
            • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Save-restore

    Restore-x86

    Signature
    (restore-x86 filename memsize x86 state) → (mv x86 state)
    Arguments
    filename — The name of the file to read the non-memory state from. The memory will be read from <filename>.mem.
        Guard (stringp filename).
    memsize — The number of bytes to read out of the memory file and into the memory.
        Guard (natp memsize).

    Definitions and Theorems

    Function: restore-x86

    (defun restore-x86 (filename memsize x86 state)
      (declare (xargs :stobjs (x86 state)))
      (declare (xargs :guard (and (stringp filename)
                                  (natp memsize))))
      (declare (xargs :guard (<= memsize *mem-size-in-bytes*)))
      (let ((__function__ 'restore-x86))
        (declare (ignorable __function__))
        (b* (((mv read-in-x86 state)
              (serialize-read filename))
             (x86 (deserialize-x86 read-in-x86 x86))
             (memfilename (concatenate 'string filename ".mem"))
             ((mv memchannel state)
              (open-input-channel memfilename
                                  :byte state))
             ((unless memchannel) (mv x86 state))
             ((mv x86 state)
              (read-mem-from-channel memsize memchannel x86 state))
             (state (close-input-channel memchannel state)))
          (mv x86 state))))