By a comparison - and perform a branch depending on the result.
You don't mention your processor, but for a PIC you can use SUB or XOR to perform a comparison, and branch based on the status register results.
If you look on the PICList there's a section about comparisons - and some of my PIC tutorials do them as well, tutorial 9.2 is one that does this - comparing an entered code for a digital lock.
if bit 0001 in regx is a one then do subroutine1 else test next bit
if bit 0010 in regx is a one then do subroutine2 else test next bit
if bit 0100 in regx is a one then do subroutine3 else test next
if bit 1000 in reg x is a one then do subroutine4 else exit
where x is any register
test if bit is 1
BTFSC Regx 0x0001 ; if bit 0 in regx = 1 do sub1 else test next bit
Sub1
BTFSC Regx 0x0010 ; if bit 1 in regx = 1 do sub2 else test next bit
Sub2
BTFSC Regx 0X0100 ;if bit 2 in regx = 1 do sub3 else test next bit
Sub3
BTFSC Regx 0x1000;if bit 3 in regx = 1 do sub4 else test next bit
Sub4
similarly
you could test if bit is not set..
BTFSS Regx 0x0001 ; if bit 0 in regx = 0 do sub1 else test next bit
Sub1
BTFSS Regx 0x0010 ; if bit 1 in regx = 0 do sub2 else test next bit
Sub2
BTFSS Regx 0X0100 ;if bit 2 in regx = 0 do sub3 else test next bit
Sub3
BTFSS Regx 0x1000;if bit 3 in regx = 0 do sub4 else test next bit
Sub4
i changed it around now it tests different registers..
BTFSC Regw b'10000000' ; if bit 7 in regw = 1 do sub1 else test next register
Sub1
BTFSC Regx b'10000000' ; if bit 7 in regx = 1 do sub2 else test next register
Sub2
BTFSC Regy b'10000000' ; if bit 7 in regy = 1 do sub3 else test next register
Sub3
BTFSC Regz b'10000000' ; if bit 7 in regz = 1 do sub4 else test next register
Sub4
i dont see how this is not an IF THEN construct
IF (bit 7 in regw is True) THEN (do something) ELSE (do something else)
its making a decision! based on conditions..