For your first example, you can just have these two bits in same byte.
And instead of having to check if these are both set, compare them with 0 by reversing their meaning :
Code:
tst.b obj_state(ax)
bne .exit
Generally, it's easier to check for 0 than check for 1 so reverse them where you can.
If you only have 2 bits and not all possible combinations need to be checked, you can use the following method (use sign bit and any other like b0, keeping all other bits =0) :
Code:
tst.b obj_state(ax)
bne .xx ; $01, $80, $81
beq .xx ; $00
bpl .xx ; $00, $01
bmi .xx ; $80, $81
bgt .xx ; $01
ble .xx ; $00, $80
Quote:
Originally Posted by Auscoder
I need all 32 bits and the code is a little bit generic so using longs.
|
That may be a big part of the problem...