DementedPurple wrote:
I understand that BPL and BMI are used when testing a bit
Well, not really. BMI and BPL will branch (or not) based on the N flag, which is just a copy of bit 7 of the result of the latest CPU operation (that happens to affect the N flag, refer to an opcode documentation to see which operations affect which flags). In 2's complement, negative numbers have bit 7 set, so that's why the flag is called N(egative). You might have gotten the impression that these were meant for testing bits because some NES registers return state information (such as the vblank flag) in bit 7, so you can conveniently use these branch instructions, even though in this particular case this has nothing to do with positive or negative values.
If you're working with signed numbers (-128 to 127 for 8 bit, -32768 to 32767 for 16-bit, and so on), use BMI and BPL to test the results of additions/subtractions/comparisons. If you subtract a number from another and the result is negative, this means that the amount being subtracted is bigger.
Quote:
but what is Carry clear, or better yet, what is Carry set?
The carry is meant for multi-byte operations and for testing unsigned results (0 to 255 for 8-bit, 0 to 65535 for 16-bit, and so on). In additions, the carry is set whenever the result doesn't fit in the number of bits you're working with, it represents an overflow. For example, 254 + 3 will result in 1 and the carry will be set, since 257 doesn't fit in 8 bits. In subtractions the carry acts as a borrow value. It must be set before subtractions (and is implicitly set before comparisons) and if a borrow is necessary (e.g. 4 - 6 will require a borrow, since 6 is larger than 4) the carry flag will be cleared. From there you can use the value of the carry flag to propagate the carry or the borrow to higher bytes in multi-byte operations or to detect if the operation caused an overflow or an underflow. An underflow (carry clear) after a subtraction/comparison means that the value being subtracted is larger.
There's also the V flag, which is meant for testing signed overflows and underflows, but let's not get into that right now.