Users browsing this thread: 1 Guest(s)
Newbie Still Doesn't Understand Code

#20
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(10-18-2016, 09:37 AM)Turbotastic Wrote: 2. If the zero flag is not set prior to this, why is BEQ behaving identically to BNE?

You have to look in the code previous to this to see where the zero flag is changed but it's a bit irrelevant to your example since CMP affect the zero flag. If the zero flag was already set and your CMP set the zero flag, it changes nothing, otherwise it will be clear. What the zero flag was prior to a CMP don't matter.

Your second example should branch if what is in A equals #$FF. Executing the branch with a debugger should prove you that. If A not equal #$FF, the code under the BEQ will be executed.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Turbotastic (10-18-2016)



Messages In This Thread
RE: Newbie Still Doesn't Understand Code - by dn - 09-21-2016, 12:06 PM
RE: Newbie Still Doesn't Understand Code - by madsiur - 10-18-2016, 03:13 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite