So you're saying 4 when not taken, and 5 when taken?
If optimising for performance, I think 3 cycles in the not-taken case is possible. You would not need to actually read the branch target offset byte, just increment the PC to point to the next instruction and read that.
sorry i guess i kinda miswrote that, for BBR and BBS it's 3 cycles when not taken and 4 when taken, regular branches are 2 when not taken, and 3 when taken.
i which is exactly 1 cycle more.
sadly I cannot shave off more cycles without using a 16 bit data bus or something.
Doc for the Rockwell 'C02 says BBS and BBR are 5 cycles (branch not taken), 6 for branch taken, or 7 for branch taken with a page crossing. It's always possible the doc contains an error, but Rockwell doc is usually very good.
oh i didn't know that the original BBR/BBS instructions had different cycles count.
i used this site for the cycle counts:
http://6502.org/tutorials/65c02opcodes.html
and it says:
Unlike other branch instructions, BBR and BBS always take the same number of cycles (five) whether the branch is taken or not.
ps- Whenever possible I avoid WDC doc and refer to Rockwell doc instead. Of course that's no good for stuff like AC timing specs (the fastest Rockwell chips are only 4 MHz), but for many details including instruction cycle counts it's fine -- I'm sure the cycle counts are identical (overlooking the fact Rockwell has no STP and WAI instructions). I've even observed that the undocumented NOP's are identical.
i didn't even know the WDC Datasheet had any cycle counts in it... i only used it to look up all instructions the CPU had.
Original post:
well i guess i finished the 65C02V, i didn't test every single instruction yet though.
but i was able to finish the Timing/Opcode table! *
the speed difference between the 65C02 and 65C02V is around 20% (on average of course)
it would be interesting to see some kind of benchmark program or something that tries to guess the clock speed of the CPU without using interrupts, and see how it would do with a regular 65C02 and this one.
*
though i still got a few questions before i call this "finished enough for now"
1. about WAI, what is the cycle count supposed to mean? i just assumed it's the amount of cycles it needs in order to get into it's stable "waiting for interrupts" loop... that is also how my version of WAI is a 1 cycle instruction, as once it read the Opcode it directly starts checking for interrupts.
2. about STP, what is the cycle count supposed to mean in this one? is it like WAI but checking for Resets instead?
3. i still need to make a circuit for BCD Addition/Subtraction and i have no idea how to do it.