anchor.diff:  (defun flag (name)
     (getf *flags* name))
   
  -(defun set-flag (name value)
  -  (setf (getf *flags* name) value))
  -
  -(defsetf flag set-flag)
  +(defsetf flag (name) (value)
  +  `(setf (getf *flags* ,name) ,value))
   
   (defun flag-p (name)
     (= (flag name) 1))
   
  -(defun set-flag-p (name is-set)
  -  (setf (flag name) (if is-set 1 0)))
  -
  -(defsetf flag-p set-flag-p)
  +(defsetf flag-p (name) (is-set)
  +  `(setf (flag ,name) (if ,is-set 1 0)))
  +
  +(defun set-flag (name)
  +  (setf (flag-p name) t))
  +
  +(defun clear-flag (name)
  +  (setf (flag-p name) nil))
   
   (defun bit-vector->integer (bit-vector)
     "Create a positive integer from a bit-vector."
  
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 (incf ,dest 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 (incf ,dest 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 (+ (decf ,dest 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 (+ (decf ,dest 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 ,dest 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)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (set-zf-on-op (set-sf-on-op (set-pf-on-op (setf ,dest (logand ,src ,dest))) ,is-word))
         (setf (flag-p :cf) nil)
         (setf (flag-p :of) nil))))
  
  (defmacro or-operation (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "or" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (set-zf-on-op (set-sf-on-op (set-pf-on-op (setf ,dest (logior ,src ,dest))) ,is-word))
         (setf (flag-p :cf) nil)
         (setf (flag-p :of) nil))))
  
  (defmacro xor-operation (src dest is-word &optional mod-bits r/m-bits)
    `(disasm-instr (list "xor" :src ,src :dest ,dest)
       (with-in-place-mod ,dest ,mod-bits ,r/m-bits
         (set-zf-on-op (set-sf-on-op (set-pf-on-op (setf ,dest (logxor ,src ,dest))) ,is-word))
         (setf (flag-p :cf) nil)
         (setf (flag-p :of) nil))))
  
  (defmacro parse-group1-byte (opcode operation mod-bits r/m-bits)
    `(case (mod ,opcode 4)
  
negative.code: 
  ;;; Flag effects
  
  (defun set-af-on-op (result operand)
    (setf (flag-p :af) (not (= (logand result #xfff0) (logand (- result operand) #xfff0))))
    result)
  
  (defun set-cf-on-add (value)
    (setf (flag-p :cf) *has-carried*)
    value)
  