anchor.diff:  
   (defun wrap-carry (value is-word)
     "Wrap around a carried value."
  -  (let* ((limit (if is-word #x10000 #x100)) (carry (>= value limit)))
  -    (setf *has-carried* carry)
  -    (if carry
  -	(mod value limit))
  -    value))
  +  (let* ((limit (if is-word #x10000 #x100)) (carry (>= value limit)) (negative (minusp value)))
  +    (setf *has-carried* (or carry negative))
  +    (cond
  +      (carry (mod value limit))
  +      (negative (+ value limit))
  +      (t value))))
   
   ;;; setf-able locations
   
  
positive.code: 
  (defmacro inc (op is-word)
    `(disasm-instr (list "inc" :op ,op)
       (set-af-on-op (set-of-on-op (set-pf-on-op (set-sf-on-op (set-zf-on-op (incf ,op)) ,is-word)) 1 ,is-word) 1)))
  
  (defmacro dec (op is-word)
    `(disasm-instr (list "dec" :op ,op)
       (set-af-on-op (set-of-on-op (set-pf-on-op (set-sf-on-op (set-zf-on-op (decf ,op)) ,is-word)) -1 ,is-word) -1)))
  
  ;; One-byte opcodes on registers
  
  
negative.code:   (setf (flag-p :cf) (> value2 value1))
    (- value1 value2))
  
  (defmacro set-of-on-op (result operation)
    `(let* ((value1 (,operation ,result value2)) (neg1 (negative-p value1 is-word)))
       (setf (flag-p :of) (and (eq neg1 (negative-p value2 is-word)) (not (eq neg1 (negative-p ,result is-word)))))
       ,result))
  
  (defun set-of-on-add (sum value2 is-word)
    (set-of-on-op sum +))
  
  (defun set-of-on-sub (diff value2 is-word)
    (set-of-on-op diff -))
  
  (defun set-pf-on-op (value)
    (setf (flag-p :pf) (evenp (logcount (logand #xff value))))
  