(first_instruction, second_instruction)
return 0
Determine if one instruction can affect flags used by the other instruction.

        @author: Cameron Hotchkies

        @type   first_instruction:  instruction
        @param  first_instruction:  The first instruction to check
        @type   second_instruction: instruction
        @param  second_instruction: The second instruction to check

        @rtype: Integer
        @return: 0 for no effect, 1 for first affects second, 2 for second affects first, 3 for both can affect
Determine if one instruction can affect flags used by the other instruction.
Determine if one instruction can affect flags used by the other instruction .
def flag_dependency (first_instruction, second_instruction):
        '''
        Determine if one instruction can affect flags used by the other instruction.

        @author: Cameron Hotchkies

        @type   first_instruction:  instruction
        @param  first_instruction:  The first instruction to check
        @type   second_instruction: instruction
        @param  second_instruction: The second instruction to check

        @rtype: Integer
        @return: 0 for no effect, 1 for first affects second, 2 for second affects first, 3 for both can affect
        '''

        if first_instruction.mnem in instruction.FLAGGED_OPCODES and second_instruction.mnem in instruction.FLAGGED_OPCODES:
            ret_val = 0

            # if neither opcodes set any flags, they can be ignored
            if instruction.FLAGGED_OPCODES[first_instruction.mnem]  & instruction.__SET_MASK > 0 and \
               instruction.FLAGGED_OPCODES[second_instruction.mnem] & instruction.__SET_MASK > 0:
                return 0

            setter = instruction.FLAGGED_OPCODES[first_instruction.mnem]  & instruction.__SET_MASK
            tester = instruction.FLAGGED_OPCODES[second_instruction.mnem] & instruction.__TEST_MASK

            if setter & (tester << 16) > 0:
                ret_val += 1

            setter = instruction.FLAGGED_OPCODES[second_instruction.mnem] & instruction.__SET_MASK
            tester = instruction.FLAGGED_OPCODES[first_instruction.mnem]  & instruction.__TEST_MASK

            if setter & (tester << 16) > 0:
                ret_val += 2

            return ret_val

        return 0
def flag_dependency ( first_instruction , second_instruction ) : if first_instruction . mnem in instruction . FLAGGED_OPCODES and second_instruction . mnem in instruction . FLAGGED_OPCODES : ret_val = 0 # if neither opcodes set any flags, they can be ignored if instruction . FLAGGED_OPCODES [ first_instruction . mnem ] & instruction . __SET_MASK > 0 and instruction . FLAGGED_OPCODES [ second_instruction . mnem ] & instruction . __SET_MASK > 0 : return 0 setter = instruction . FLAGGED_OPCODES [ first_instruction . mnem ] & instruction . __SET_MASK tester = instruction . FLAGGED_OPCODES [ second_instruction . mnem ] & instruction . __TEST_MASK if setter & ( tester << 16 ) > 0 : ret_val += 1 setter = instruction . FLAGGED_OPCODES [ second_instruction . mnem ] & instruction . __SET_MASK tester = instruction . FLAGGED_OPCODES [ first_instruction . mnem ] & instruction . __TEST_MASK if setter & ( tester << 16 ) > 0 : ret_val += 2 return ret_val return 0