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

Re: 6502 flag behaviour



In article <334D7DEE.1141@erols.com>, Sasha Cimermanis  <scim@erols.com> wrote:
>
>Hi everyone,
>
>
>I'm trying to help someone out regarding 6502 flag behaviour. Here is
>the problem.
>
>I have recently encountered a following piece of code:
>
>lda $FE
>ora #$08
>bne <somewhere I don't want it to bne>
>
>From all the sources on 6502 it appears that the Z flag will always be
>reset at the time of BNE, as we do ORA with a non-zero number. But then,
>this fragment of code loses any sense. Does anyone know how Z flag
>behaves
>in such situation?
>
Unless your 'lda' is a lda immediate, you can't guarantee the value in the
accumulator.  It's what ever value is currenly in $00FE.

John

--
--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
- John Bowling          -- Shouldn't you be commuting by bicycle?
- johnlb@primenet.com   -- No, that's not a valid excuse!
--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--