anchor.diff:    "Write a word to a RAM segment."
     `(progn
        (setf (elt ,segment ,location) (logand ,value #x00ff))
  -     (setf (elt ,segment (1+ ,location)) (ash (logand ,value #xff00) -8))))
  +     (setf (elt ,segment (1+ ,location)) (ash (logand ,value #xff00) -8))
  +     ,value))
   
   (defun indirect-address (mod-bits r/m-bits is-word)
     "Read from an indirect address."
  
positive.code: 
  ;; Binary-coded decimal
  
  (defun ascii-adjust-after-add-or-sub (addition?)
    (disasm-instr (if addition? '("aaa") '("aas"))
      (let ((adjusted (or (> (logand (byte-register :al) #x0f) 9) (flag-p :af))))
        (if adjusted
  	  (if addition? (incf (register :ax) #x106) (decf (register :ax) #x106)))
        (setf (flag-p :af) adjusted)
        (setf (flag-p :cf) adjusted)
        (logandf (byte-register :al) #x0f))))
  
  (defun decimal-adjust-after-add-or-sub (addition?)
    (disasm-instr (if addition? '("daa") '("das"))
      (let ((old-al (byte-register :al)) (old-cf (flag-p :cf))) 
  	  (when (or (> (logand (byte-register :al) #x0f) 9) (flag-p :af))
  	    (if addition? (incf (byte-register :al) 6) (decf (byte-register :al) 6))
  	    (setf (flag-p :cf) (or old-cf *has-carried*))
  	    (set-flag :af))
  	  (when (or (> old-al #x9f) old-cf)
  	    (if addition? (incf (byte-register :al) #x60) (decf (byte-register :al) #x60))
  	    (set-flag :cf))
  	  (set-zf-on-op (set-sf-on-op (set-pf-on-op (byte-register :al)) nil)))))
  
  ;;; Opcode parsing
  
  
negative.code:   `(disasm-instr (list "add" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (let ((src-value ,src))
  	 (set-zf-on-op (set-sf-on-op (set-pf-on-op (set-of-on-op (set-cf-on-add (set-af-on-add (incf ,dest src-value) src-value)) src-value ,is-word)) ,is-word))))))
  
  (defmacro add-with-carry (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "adc" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (let ((src-plus-cf (+ ,src (flag :cf))))
  	 (set-zf-on-op (set-sf-on-op (set-pf-on-op (set-of-on-op (set-cf-on-add (set-af-on-add (incf ,dest src-plus-cf) src-plus-cf)) src-plus-cf ,is-word)) ,is-word))))))
  
  (defmacro sub-without-borrow (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "sub" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (let ((src-value ,src))
  	 (set-zf-on-op (set-sf-on-op (set-pf-on-op (set-of-on-op (set-cf-on-sub (set-af-on-sub (+ (decf ,dest src-value) src-value) src-value) src-value) src-value ,is-word)) ,is-word))))))
  
  (defmacro sub-with-borrow (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "sbb" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (let ((src-plus-cf (+ ,src (flag :cf))))
  	 (set-zf-on-op (set-sf-on-op (set-pf-on-op (set-of-on-op (set-cf-on-sub (set-af-on-sub (+ (decf ,dest src-plus-cf) src-plus-cf) src-plus-cf) src-plus-cf) src-plus-cf ,is-word)) ,is-word))))))
  
  (defmacro cmp-operation (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "cmp" :src ,src :dest ,dest)
       (let ((src-value ,src))
         (set-zf-on-op (set-sf-on-op (set-pf-on-op (set-of-on-op (set-cf-on-sub (set-af-on-sub ,dest src-value) src-value) src-value ,is-word)) ,is-word)))))
  
  (defmacro and-operation (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "and" :src ,src :dest ,dest)
  