A push instruction between sub and breq.
mov temp, chrWmax sub temp, chrWval ;count = chrWmax - chrWval push temp ;keep count breq cntZero
A push instruction between sub and breq.
mov temp, chrWmax sub temp, chrWval ;count = chrWmax - chrWval push temp ;keep count breq cntZero
Surely the possible bug is down to whether all destination paths have a balancing POP? Show some more context.
Yes, provided the push/pop is balanced in either branch. The push instruction doesn't affect any flags so your SUB status bits will be seen intact in either branch destination.
Yes there is pop instruction further down in the code.
--- mov temp, chrWmax sub temp, chrWval ;count = chrWmax - chrWval push temp ;keep count breq cntZero . . cntZero: . . . pop temp ;fetch count ---
No problem, ok. 8)
Looks like trouble... use another reg or store the value.
Brad
. . . . .
And nothing more happens on the stack within those "...."?
If the original question is all you're interested in (restated: does a push affect the flags?), then you're fine.
If you're having a difficulty and have traced it back to this sequence of instructions, then your problem is elsewhere (as suggested above).
But without seeing any more code, it would seem like the stack operation is just a waste of time since temp is not changed past the branch.
Looks like a puzzle with too many pieces missing, so I will take another blind guess and ask... maybe you also need SBC as well as SUB?
Getting close yet?
Brad
RES is the perpetual riddle poster 8) usually adding only minute fractions of a piece of the puzzle every other so many posts...
Bring it!
Brad