anchor.diff:        (#b00 (if ,is-word (setf (word-in-ram address-base *ram*) ,value) (setf (byte-in-ram address-base *ram*) ,value)))
         (#b01 (if ,is-word (setf (word-in-ram (+ address-base (peek-at-instruction)) *ram*) ,value) (setf (byte-in-ram (+ address-base (peek-at-instruction)) *ram*) ,value)))
         (#b10 (if ,is-word (setf (word-in-ram (+ address-base (peek-at-word)) *ram*) ,value) (setf (byte-in-ram (+ address-base (peek-at-word)) *ram*) ,value)))
  -      (#b11 (if ,is-word (setf (register (bits->word-reg ,r/m-bits)) ,value) (setf (byte-register (bits->byte-reg ,r/m-bits)) ,value))))))
  +      (#b11 (if ,is-word (setf (register (bits->word-reg ,r/m-bits)) ,value) (setf (byte-register (bits->byte-reg ,r/m-bits)) ,value))))
  +    ,value))
   
   ;;; setf wrappers
   
  
positive.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-op (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-op (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-op (+ (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-op (+ (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-af-on-op (set-cf-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)
  
negative.code: 
  ;; Binary-coded decimal
  
  (defmacro ascii-adjust-after-add-or-sub (modifier)
    `(let ((adjusted (or (> (logand (byte-register :al) #x0f) 9) (flag-p :af))))
       (when adjusted
         (,modifier (register :ax) #x106))
       (setf (flag-p :af) adjusted)
       (setf (flag-p :cf) adjusted)
       (logandf (byte-register :al) #x0f)))
  
  (defmacro decimal-adjust-after-add-or-sub (modifier)
    `(let ((old-al (byte-register :al)) (old-cf (flag-p :cf)))
       (when (or (> (logand (byte-register :al) #x0f) 9) (flag-p :af))
         (,modifier (byte-register :al) 6)
         (setf (flag-p :cf) (or old-cf *has-carried*))
         (set-flag :af))
       (when (or (> old-al #x99) old-cf)
         (,modifier (byte-register :al) #x60)
         (set-flag :cf))
       (set-zf-on-op (set-sf-on-op (set-pf-on-op (byte-register :al)) nil))))
  
  (defun ascii-adjust-after-addition ()
    (disasm-instr '("aaa")
      (ascii-adjust-after-add-or-sub incf)))
  
  (defun ascii-adjust-after-subtraction ()
    (disasm-instr '("aas")
      (ascii-adjust-after-add-or-sub decf)))
  
  (defun decimal-adjust-after-addition ()
    (disasm-instr '("daa")
      (decimal-adjust-after-add-or-sub incf)))
  
  (defun decimal-adjust-after-subtraction ()
    (disasm-instr '("das")
      (decimal-adjust-after-add-or-sub decf)))
  
  ;;; Opcode parsing
  
  