anchor.diff:  ;;; Flag effects
   
   (defun set-cf-on-add (value is-word)
  -  (setf (flag-p :cf) (if is-word (>= (/ value #x10000) 1) (>= (/ value #x100) 1)))
  +  (setf (flag-p :cf) (if is-word (>= value #x10000) (>= value #x100)))
     (wrap-overflow value is-word))
   
   (defun set-cf-on-sub (value1 value2)
  
positive.code:     ((= opcode #xf8) (clear-carry-flag))
      ((= opcode #xf9) (set-carry-flag))))
  
  (defun loop-instructions (&optional (return-disasm nil))
    "Loop through loaded instructions."
    (setf *disasm* return-disasm)
    (loop
       for ret = (parse-opcode (next-instruction))
       collecting ret into disasm
       until (equal ret '("hlt"))
       finally (return (if return-disasm disasm t))))
  
  (defparameter *test-instructions* #(#x40 #x40 #x40 #x91 #xb0 #xff #x50 #x5a #x52 #x51 #x48 #xbe #x02 #x03 #xf4))
  
negative.code:   value1)
  
  (defun set-sf-on-op (value is-word)
    (setf (flag-p :sf) (if is-word (>= value #x8000) (>= value #x80)))
    value)
  
  (defun set-zf-on-op (value)
  