Kevin19 said:
spitting out three actually indicates the bits placement in the byte so i think it is pretty much the ultimate indicator that we have unless we used something lower than this language
and the fact that the number is signed and unsigned does not really change anything i checked it out both ways and it seems to do the same thing
I do not want to be ungrateful of your help
but please put your code to test before you post it
It might mislead the unwise to great mistakes
Most of that post was just a repeat of what I said, also, that code was tested. The problem with your code is that you're only writing to two bits of the entire byte. Meaning that the values of your flags register could only be 0, 1, 2, or 3. My code works as I have tested it, but here's a suggestion for testing yours. Try setting your flagss to something like this:
Negative = 1
Overflow = 1
BreakPoint = 1
Zero = 0
and then try reading out the values for each flag:
Code:
Negative = (P>>0)&0x1; //< Should work fine.
Overflow = (P>>1)&0x1; //< Whoops, error!.
BreakPoint = (P>>4)&0x1; //< Whoops, error!
Zero = (P>>6)&0x1; //< Works fine.
I think you'll see that performing tests similar to that should show whose code truly works and whose doesn't. I'm not trying to start a flame war, merely I'm trying to help you fix a bug, so please just test my advice and answer truthfully. I've already tested your code and it failed.