Users browsing this thread: 2 Guest(s)
Having the option to use Vigor in some spells

#50
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
(05-08-2016, 12:29 PM)Madsiur Wrote: Unrelated: When does the carry flag can lead to a bug? I know you must always clear it (CLC) before an addition, but given you make a BCC or BCS and reach after in an unexpected way another BCC / BCS, the carry flag will still be based on the operation often right before the last BCC / BCS. What am I missing here?

You don't need to clear the carry for addition if your intention is to have the result be +1. Off the top of my head, one such example is in the Steal function. 

The carry flag can get set by ADC/SBC, LSR/ASL, ROR/ROL, CMP/CPX/CPY, (and SEP/SEC). A wrongfully set/cleared carry flag would most commonly mess up conditional branches and cause bugs that way, but I guess with careless bit rotations it could cause some values to be wrong in a catastrophic way (messing with BEQ/BNE for example). I'm still a novice to assembly and haven't done a lot of debugging (except for my own code) so I'm not particularly familiar with common bug-causing scenarios. Smile
  Find
Quote  



Messages In This Thread
RE: Having the option to use Vigor in some spells - by seibaby - 05-08-2016, 03:09 PM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite