The problem is no matter what the clear bit instruction executes regardless if the button is on or off. Any assistance in this matter would be greatly appreciated.
That's because you always flow from BSET into BCLR, you need a BRA that jumps over BCLR after BSET has been executed.
However, what are you trying to do exactly? Why do you have a variable for pad_button_a individually? It seems pretty unnecessary to "split" button bits from the joystick state and then rejoin them again ( if that's what you're trying to do ).
btst #pad_button_a,d0 ; test bit bne .NOA ; branch if not equal bset #FLAG_FRET_GREEN,(fret_flags) ; otherwise set bit bra.s .DONE ; branch to DONE after set
.NOA: bclr #FLAG_FRET_GREEN,(fret_flags) ; clear bit ; we fall through from here into .DONE automagically due to program flow... ; place a bsr, jsr, jmp command here to go somewhere else after clearing bit.. .DONE: rts ; return maybe?
Last Edit: Nov 16, 2015 9:49:28 GMT -5 by lunchbox