Hello,
I have reading the 6502 bugs doc on your site and I have a few questions
about it.
I read that "the status bits pushed on the stack by PHP have the
breakpoint bit set", however, the 6502 emulator by Marat Fayzullin
seems to handle the situation so that the PLP instruction sets the B bit
when it pops the P register from the stack.
It is a little different, because if I write code like:
PHP
PLA
in the first case I should get an 1 in the breakpoint bit,
but in the second I get 0, and so for the 5th bit of the P register,
that should be always 1. So, what is the right way?
Moreover, I would like to know, in the official rockwell docs seems
that 2 CPU cycles must be added if branch occurs to different page
in instructions like BCS, BNE. What it means exactly? It refers
to a different page from the address the branch instruction is, or
it expects that the pc counter is already incremented (even if it needs
to be updated). The page crossing 1 cycle for instructions like AND (IND), Y
seems not to be handled by Marat code. Why?
All my questions refers specifically to NES cpu, not to 6502
in general.
Your help will be much appreciated,
Thanks,
tano
I have reading the 6502 bugs doc on your site and I have a few questions
about it.
I read that "the status bits pushed on the stack by PHP have the
breakpoint bit set", however, the 6502 emulator by Marat Fayzullin
seems to handle the situation so that the PLP instruction sets the B bit
when it pops the P register from the stack.
It is a little different, because if I write code like:
PHP
PLA
in the first case I should get an 1 in the breakpoint bit,
but in the second I get 0, and so for the 5th bit of the P register,
that should be always 1. So, what is the right way?
Moreover, I would like to know, in the official rockwell docs seems
that 2 CPU cycles must be added if branch occurs to different page
in instructions like BCS, BNE. What it means exactly? It refers
to a different page from the address the branch instruction is, or
it expects that the pc counter is already incremented (even if it needs
to be updated). The page crossing 1 cycle for instructions like AND (IND), Y
seems not to be handled by Marat code. Why?
All my questions refers specifically to NES cpu, not to 6502
in general.
Your help will be much appreciated,
Thanks,
tano