Users browsing this thread: 1 Guest(s)
Newbie Still Doesn't Understand Code
10-18-2016, 03:13 PM
(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.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)