library/src/decoders/x86ASM/BP-x86InstDecode.cc
// Tests the RM byte in an instruction to see if it contains a valid modr/m byte.
// greater then 1 for true, 0 for false
Tests the RM byte in an instruction to see if it contains a valid modr/m byte.
greater then 1 for true, 0 for false
Tests the RM byte in an instruction to see if it contains a valid modr / m byte . greater then 1 for true 0 for false
size_t X86_32_InstructionContainsValidModRM(P_X86_32_INSTRUCTION instruction){
	for(size_t i = 0; i < instruction->opcodeOperandCount; i++){
		if(instruction->opcodeOperand[i] != 0){
			if(X86_32_IsOperandMemOnly(instruction->opcodeOperand[i]) != 0)
				return true;
			if(X86_32_IsOperandRegOnly(instruction->opcodeOperand[i]) != 0)
				return true;
			if(X86_32_IsOperandRm(instruction->opcodeOperand[i]) != 0)
				return true;
			switch(instruction->opcodeOperand[i]){
				case OA_RM_ONLY_0:
					return true;
				case OA_RM_ONLY_1:
					return true;
				case OA_RM_ONLY_2:
					return true;
				case OA_RM_ONLY_3:
					return true;
				case OA_RM_ONLY_4:
					return true;
				case OA_RM_ONLY_5:
					return true;
				case OA_RM_ONLY_6:
					return true;
				case OA_RM_ONLY_7:
					return true;
			}
		}
	}
	return 0;
}
size_t X86_32_InstructionContainsValidModRM ( P_X86_32_INSTRUCTION instruction ) { for ( size_t i = 0 ; i < instruction -> opcodeOperandCount ; i ++ ) { if ( instruction -> opcodeOperand [ i ] != 0 ) { if ( X86_32_IsOperandMemOnly ( instruction -> opcodeOperand [ i ] ) != 0 ) return true ; if ( X86_32_IsOperandRegOnly ( instruction -> opcodeOperand [ i ] ) != 0 ) return true ; if ( X86_32_IsOperandRm ( instruction -> opcodeOperand [ i ] ) != 0 ) return true ; switch ( instruction -> opcodeOperand [ i ] ) { case OA_RM_ONLY_0 : return true ; case OA_RM_ONLY_1 : return true ; case OA_RM_ONLY_2 : return true ; case OA_RM_ONLY_3 : return true ; case OA_RM_ONLY_4 : return true ; case OA_RM_ONLY_5 : return true ; case OA_RM_ONLY_6 : return true ; case OA_RM_ONLY_7 : return true ; } } } return 0 ; }
Tests the RM byte in an instruction to see if it contains a valid modr/m byte.
Tests the RM byte in an instruction to see if it contains a valid modr / m byte .
// If there is a forward slash in the operand then maybee // for slash digit ones // Not a valid byte, returning