title: Are the bytes stored in 6502 memory signed or unsigned?
body: <p>While creating instruction functions for my 6502/NES emulator, I got stuck at understanding the concept of signed bytes and two's complement in the 6502. So apparently, branch instructions such as BMI use a signed byte in memory for forwards/backwards branching, and some instructions allow arithmetic operations with negative numbers. Also the negative flag detects the 7th bit of the accumulator. (Two's complement)</p>
  
  <p>Does this mean that all bytes in memory are signed and I could initialize the memory as <code>int8_t CPUMEMORY[0x10000];</code> and not <code>uint8_t CPUMEMORY[0x10000]</code>?</p>
  
  <p>The thing that is bothering me though, is that the carry flag is set when an operation result exceeds the unsigned 8 bit limit, which is 255. But shouldn't this be 127 if all bytes are signed? (The overflow flag does this, but then what is the point of having a carry flag?)</p>