[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Page Boundary Question



Laine,

    I know the trick how to use ADC's magic.  One extra cycle is always
added while $20FF goes into $2100.  The problem is that it will not add one
extra cycle if $2000 goes into $1FFF.  The 6502 Reference Manual says that
$1FFF + 1 will add one cycle, but $2000 - 1 will not add one cycle.
    The positive always adds one cycle, but how can negative works?

Bryan Parkoff

"Laine Houghton" <laine@@@intergate.com> wrote in message
news:3eedd2a7_3@newsfeed...
> Through the magic of ADC.
>
>  CLC
>  LDA #$02
>  ADC #$EC
>  BCC NO CYCLE
>
>  CLC
>  LDA #$82
>  ADC #$7F
>  BCS ADD CYCLE
>
> "Bryan Parkoff" <spam> wrote in message
> qjydnTqraqY0xXCjXTWcqA@texas.net">news:qjydnTqraqY0xXCjXTWcqA@texas.net...
> >     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.
> >
> > Bryan Parkoff
> >
> >
>
>