• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Introduction
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • Syscalls
          • Cpuid
          • X86isa-state
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • X86-modes
          • Segmentation
            • Ea-to-la
            • Segment-base-and-bounds
            • Ia32e-segmentation
            • Eas-to-las
              • Ia32-segmentation
            • Register-readers-and-writers
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • Proof-utilities
          • To-do
          • Concrete-simulation-examples
          • Model-validation
          • Utils
          • Debugging-code-proofs
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Segmentation

    Eas-to-las

    Translate a sequence of contiguous effective addresses to linear addresses.

    Signature
    (eas-to-las proc-mode n eff-addr seg-reg x86) 
      → 
    (mv flg lin-addrs)
    Arguments
    n — Guard (natp n).
    Returns
    lin-addrs — A nil-terminated list of i64ps.

    The contiguous effective addresses are eff-addr through eff-addr + n - 1. These effective addresses are translated in increasing order. When the translation of an effective address fails, the recursion stops and the error flag is returned.

    Definitions and Theorems

    Function: eas-to-las

    (defun eas-to-las
           (proc-mode n eff-addr seg-reg x86)
           (declare (xargs :stobjs (x86)))
           (declare (type (integer 0 4) proc-mode)
                    (type (signed-byte 64) eff-addr)
                    (type (integer 0 5) seg-reg))
           (declare (xargs :guard (natp n)))
           (let ((__function__ 'eas-to-las))
                (declare (ignorable __function__))
                (if (zp n)
                    (mv nil nil)
                    (b* (((mv flg lin-addr)
                          (ea-to-la proc-mode eff-addr seg-reg 1 x86))
                         ((when flg) (mv flg nil))
                         (eff-addr+1 (i64 (1+ eff-addr)))
                         ((mv flg lin-addrs)
                          (eas-to-las proc-mode (1- n)
                                      eff-addr+1 seg-reg x86))
                         ((when flg) (mv flg nil)))
                        (mv nil (cons lin-addr lin-addrs))))))