[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Page Boundary Question
Bryan Parkoff asked:
> I understand that 6502 can only add one extra cycle if it is across page
>boundaries.
>
> For example,
>
>2000: A9 00 LDA #00
>2002: F0 EC BEQ 1FF0
>
> If BEQ is true, it will branch to $1FF0. Extra cycle is supposed to be
>added, but it didn't.
>
>2080: A9 00 LDA #00
>2082: F0 7F BEQ 2103
>
> If BEQ is true, it will branch to $2103. Extra cycle will be added.
>($20)$82 + $7F will always show carry flag that will let cycle to know
>before it is added. How can 6502 know that ($20)$04 + $EC will not always
>show carry flag? Please explain. It is what 6502 Reference Manual says
>that branch can only add one extra cycle if carry flag is present.
It's easy--it just does the signed addition and tests whether there
was a carry out. If there was, then the high-order address byte
must be incremented/decremented by one, and that operation
takes the extra cycle.
None of this affects the programmer-visible carry flag.
-michael
Check out amazing quality 8-bit Apple sound on my
Home page: http://members.aol.com/MJMahon/