anchor.diff:       (#x55 4 2 zero-page-x)
        (#x59 4 3 absolute-y)
        (#x5d 4 3 absolute-x))
  -  (let ((result (setf (cpu-ar cpu) (logxor (funcall mode cpu) (cpu-ar cpu)))))
  -    (set-flags-nz cpu result)))
  -
  -(defopcode inc (:docs "Increment Memory")
  +  (let ((result (setf (cpu-ar cpu) (logxor (getter mode style cpu) (cpu-ar cpu)))))
  +    (set-flags-nz cpu result)))
  +
  +(defasm inc (:docs "Increment Memory")
       ((#xe6 5 2 zero-page)
        (#xee 6 3 absolute)
        (#xf6 6 2 zero-page-x)
        (#xfe 7 3 absolute-x))
  -  (let ((result (wrap-byte (1+ (funcall mode cpu)))))
  -    (funcall setf-form result)
  -    (set-flags-nz cpu result)))
  -
  -(defopcode inx (:docs "Increment X register")
  +  (let ((result (wrap-byte (1+ (getter mode style cpu)))))
  +    (setter mode result cpu)
  +    (set-flags-nz cpu result)))
  +
  +(defasm inx (:docs "Increment X register")
       ((#xe8 2 1 implied))
     (let ((result (setf (cpu-xr cpu) (wrap-byte (1+ (cpu-xr cpu))))))
       (set-flags-nz cpu result)))
   
  -(defopcode iny (:docs "Increment Y register")
  +(defasm iny (:docs "Increment Y register")
       ((#xc8 2 1 implied))
     (let ((result (setf (cpu-yr cpu) (wrap-byte (1+ (cpu-yr cpu))))))
       (set-flags-nz cpu result)))
   
  -(defopcode jmp (:docs "Jump Unconditionally" :addr-style :raw :track-pc nil)
  +(defasm jmp (:docs "Jump Unconditionally" :raw t :track-pc nil)
       ((#x4c 3 3 absolute)
        (#x6c 5 3 indirect))
  -  (setf (cpu-pc cpu) (funcall mode cpu)))
  -
  -(defopcode jsr (:docs "Jump to Subroutine" :addr-style :raw :track-pc nil)
  +  (setf (cpu-pc cpu) (getter mode style cpu)))
  +
  +(defasm jsr (:docs "Jump to Subroutine" :raw t :track-pc nil)
       ((#x20 6 3 absolute))
     (stack-push-word (wrap-word (1+ (cpu-pc cpu))) cpu)
  -  (setf (cpu-pc cpu) (funcall mode cpu)))
  -
  -(defopcode lda (:docs "Load Accumulator from Memory")
  +  (setf (cpu-pc cpu) (getter mode style cpu)))
  +
  +(defasm lda (:docs "Load Accumulator from Memory")
       ((#xa1 6 2 indirect-x)
        (#xa5 3 2 zero-page)
        (#xa9 2 2 immediate)
  
positive.code:      (#xf9 4 3 absolute-y)
       (#xfd 4 3 absolute-x))
    (flet ((flip-bit (position x) (logxor (expt 2 position) x)))
      (let* ((val (funcall mode cpu))
             (result (- (cpu-ar cpu) val (flip-bit 0 (status-bit :carry cpu)))))
        (set-flags-if cpu :zero (zerop (wrap-byte result))
                      :overflow (overflow-p result (cpu-ar cpu) (flip-bit 7 val))
  
negative.code:      (#x15 4 2 zero-page-x)
       (#x19 4 3 absolute-y)
       (#x1d 4 3 absolute-x))
    (let ((result (setf (cpu-ar cpu) (logior (cpu-ar cpu) (getter mode style cpu)))))
      (set-flags-nz cpu result)))
  
  (defasm pha (:docs "Push Accumulator")
      ((#x48 3 1 implied))
    (stack-push (cpu-ar cpu) cpu))
  
  (defasm php (:docs "Push Processor Status")
      ((#x08 3 1 implied))
    (stack-push (logior (cpu-sr cpu) #x10) cpu))
  
  (defasm pla (:docs "Pull Accumulator from Stack")
      ((#x68 4 1 implied))
    (let ((result (setf (cpu-ar cpu) (stack-pop cpu))))
      (set-flags-nz cpu result)))
  
  (defasm plp (:docs "Pull Processor Status from Stack")
      ((#x28 4 1 implied))
    (let ((result (logior (stack-pop cpu) #x20)))
      (setf (cpu-sr cpu) (logandc2 result #x10))))
  
  (defasm rol (:docs "Rotate Left" :raw :mixed)
      ((#x2a 2 1 accumulator)
       (#x26 5 2 zero-page)
       (#x2e 6 3 absolute)
       (#x36 6 2 zero-page-x)
       (#x3e 7 3 absolute-x))
    (let* ((val (getter mode style cpu))
           (result (wrap-byte (rotate-byte val 1 cpu))))
      (setter mode result cpu)
      (set-flags-if cpu :carry (logbitp 7 val))
      (set-flags-nz cpu result)))
  
  (defasm ror (:docs "Rotate Right" :raw :mixed)
      ((#x66 5 2 zero-page)
       (#x6a 2 1 accumulator)
       (#x6e 6 3 absolute)
       (#x76 6 2 zero-page-x)
       (#x7e 7 3 absolute-x))
    (let* ((val (getter mode style cpu))
           (result (wrap-byte (rotate-byte val -1 cpu))))
      (setter mode result cpu)
      (set-flags-if cpu :carry (logbitp 0 val))
      (set-flags-nz cpu result)))
  
  (defasm rti (:docs "Return from Interrupt")
      ((#x40 6 1 implied))
    (setf (cpu-sr cpu) (logior (stack-pop cpu) #x20))
    (setf (cpu-pc cpu) (stack-pop-word cpu)))
  
  (defasm rts (:docs "Return from Subroutine" :track-pc nil)
      ((#x60 6 1 implied))
    (setf (cpu-pc cpu) (1+ (stack-pop-word cpu))))
  
  ; TODO: Add support for Decimal mode. (not supported on NES)
  (defasm sbc (:docs "Subtract from Accumulator with Carry")
      ((#xe1 6 2 indirect-x)
       (#xe5 3 2 zero-page)
       (#xe9 2 2 immediate)
  