/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  DasmX86.DLL ԰汾 1.0 ˵
//
//  ԲһṩԴ룡(16λĴûвԣڻ⣩
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

DLL5:

long	  getversion();	  //汾16λ汾ŵ16λΰ汾
char   *  getauthor();	  //
int	  getbits();	  //ȡģʽ16/32λ
void	  setbits(int bits);//ùģʽ16/32λ bits=1632Ч
int	  disassemble(unsigned long address,unsigned char *pBMC,char * pHIS,char * pHAS,long * pCIL,long * pNIO);//

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  : int disassemble(unsigned long,unsigned char *,char *,char *,long *,long *)
//
//  : ֽ								
//
//  :
//		  1. address					ַ
//		  2. pBMC (Binary Machie Code)			ָֽ
//		  3. pHIS (Hex Instruction String)		HEXַָ
//		  4. pHAS (Hex Asmble String)			ASMַָ
//		  5. pCIL (Current Instruction Length)	        ָָ
//		  6. pNIO  		                        ʱ
//	
//  :
//         0   ɹ
//        -1   
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Demo disassembleֽнзĵ
//
// pBMC ָֽ
//
// len ֽг 
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Demo(unsigned char *pBMC,int len)
{
 
	char pHIS[256];
	char pHAS[256];
	long base=0x10003FD3; 
	long CIL=0,NIO=0;
	long offset=0,address;

	while(offset<len)
	{
		address=base+offset;
		if(dissamble(address,pBMC+offset,pHIS,pHAS,&CIL,&NIO)==0)
		{
		   offset+=CIL;
		}
		else
		{
	           sprintf(pHIS,"%02X",pBMC[offset]);
		   sprintf(pHAS,"DB %02X",pBMC[offset]);
 		   offset++;
		}
	       printf("%08X %-25s %s\n",address,pHIS,pHAS);
	}

}