anchor.diff:        (t value))))
   
   (defun sign-extend (value)
  +  "Return a signed byte sign-extended to a word."
     (wrap-carry (twos-complement value nil) t))
   
   (defun segment-calc (seg offset)
  +  "Calculate an absolute address using a segment:offset pair."
     (logand (+ (ash seg 4) offset) #xfffff))
   
   (defun current-ip ()
  +  "Calculate the current instruction pointer value with the CS segment."
     (disasm-instr (segment-calc 0 *ip*)
       (segment-calc (segment :cs) *ip*)))
   
  
positive.code: ;; RAM
  
  (defun segmented-byte-in-ram (seg offset)
    (let ((real-seg (default-seg-to *default-segment* seg)))
      (byte-in-ram (segment-calc (segment real-seg) offset))))
  
  (defsetf segmented-byte-in-ram (seg offset) (value)
    `(let ((real-seg (default-seg-to *default-segment* ,seg)))
       (setf (byte-in-ram (segment-calc (segment real-seg) ,offset)) ,value)))
  
  (defun segmented-word-in-ram (seg offset)
    (let ((real-seg (default-seg-to *default-segment* seg)))
      (word-in-ram (segment-calc (segment real-seg) offset))))
  
  (defsetf segmented-word-in-ram (seg offset) (value)
    `(let ((real-seg (default-seg-to *default-segment* ,seg)))
       (setf (word-in-ram (segment-calc (segment real-seg) ,offset)) ,value)))
  
  (defun indirect-address (mod-bits r/m-bits is-word)
    "Read from an indirect address."
    (disasm-instr
        (if (= mod-bits #b11) (register (if is-word (bits->word-reg r/m-bits) (bits->byte-reg r/m-bits)))
  	  (let ((base-index (address-for-r/m mod-bits r/m-bits)))
  
negative.code:     (bit-vector->integer flags)))
  
  (defsetf flags-register (&optional (is-word t)) (value)
    "Write the flags as the FLAGS register."
    `(progn
       (setf (flag-p :cf) (logbitp 0 ,value))
       (setf (flag-p :pf) (logbitp 2 ,value))
  