/*
 * MUL.c
 *
 *  Created on: 2019-8-28
 *      Author: charles_cai
 */
#include"main.h"

#ifndef MUL_C_
#define MUL_C_

/*
 * ³ÌÐò¹¦ÄÜ£º·µ»Ø a*b
 */
unsigned long Mul_A_B(unsigned int a,unsigned int b)
{
	unsigned long value;
	MULAH =a>>8;
	MULAL =a&0xFF;

	MULBH =b>>8;
	MULBL =b&0xFF;

	MULEN =1;
	while(!MULIF);

	value =MULRES3;
	value =value <<8;
	value +=MULRES2;
	value =value <<8;
	value +=MULRES1;
	value =value <<8;
	value +=MULRES0;

	MULEN =0;

	return value;
}

#endif /* MUL_C_ */
