SBC          SBC Subtract memory from accumulator with borrow         SBC
  Operation:  A - M - ~C -> A                           N V - B D I Z C
         -                                              / / . . . . / /
    Note:C = Borrow
  +----------------+-----------------------+---------+---------+----------+
  | Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
  +----------------+-----------------------+---------+---------+----------+
  |  Immediate     |   SBC #$FF            |   $E9   |    2    |    2     |
  |  ZeroPage      |   SBC $FF             |   $E5   |    2    |    3     |
  |  ZeroPage,X    |   SBC $FF,X           |   $F5   |    2    |    4     |
  |  Absolute      |   SBC $FFFF           |   $ED   |    3    |    4     |
  |  Absolute,X    |   SBC $FFFF,X         |   $FD   |    3    |    4*    |
  |  Absolute,Y    |   SBC $FFFF,Y         |   $F9   |    3    |    4*    |
  |  (Indirect,X)  |   SBC ($FF,X)         |   $E1   |    2    |    6     |
  |  (Indirect),Y  |   SBC ($FF),Y         |   $F1   |    2    |    5*    |
  +----------------+-----------------------+---------+---------+----------+
  * Add 1 when page boundary is crossed.
  For penalty cycles on the 65816, check the desired addressing mode.
  Note: See CPU-Bugs for a description how flags are affected.
 Illegal Version:
  +----------------+-----------------------+---------+---------+----------+
  | Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
  +----------------+-----------------------+---------+---------+----------+
  |  Immediate     |   SBC #$FF            |   $EB   |    2    |    2     |
  +----------------+-----------------------+---------+---------+----------+
  There doesn't seem to be a difference to the legal SBC.
 65816 Extensions:
  +----------------+-----------------------+---------+---------+----------+
  | Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
  +----------------+-----------------------+---------+---------+----------+
  | AbsoluteLong   |   SBC $FFFFFF         |   $EF   |    4    |     5    |
  | AbsoluteLong,X |   SBC $FFFFFF,X       |   $FF   |    4    |     5    |
  | (Indirect)     |   SBC ($FF)           |   $F2   |    2    |     5    |
  | [Indirect Long]|   SBC [$FF]           |   $E7   |    2    |     6    |
  | [Ind.Long],Y   |   SBC [$FF],Y         |   $F7   |    2    |     6    |
  | Relative,S     |   SBC $FF,S           |   $E3   |    2    |     4    |
  | (Indirect,S),Y |   SBC ($FF,S),Y       |   $F3   |    2    |     7    |
  +----------------+-----------------------+---------+---------+----------+
What it does: Subtracts a byte in memory from the byte in the Accumulator, and "borrows" if necessary. If a "borrow" takes place, the carry flag is cleared (set to 0). Thus, you always SEC (set the carry flag) before an SBC operation so you can tell if you need a "borrow." In other words, when an SBC operation clears the carry flag, it means that the byte in memory was larger than the byte in the Accumulator. And since memory is subtracted from the Accumulator in an SBC operation, if memory is the larger number, we must "borrow."
Major uses: Subtracts one number from another.