Esempio n. 1
0
static void LDX()
{
	uint8 dst, src;

	get8_dis();			//00
	dst = get8_dis();	//#8
	get8_dis();			//00
	src = get8_dis();	//#
	get8_dis();			//00
	sprintf(instr, "LDX (0x%02X),0x%02X", dst, src);
}
static void ExR32()
{
	uint8 data = get8_dis();

	if (data == 0x03)
	{
		uint8 rIndex, r32;
		r32 = get8_dis();	//r32, upper 6 bits
		rIndex = get8_dis();	//r8 / r16
		sprintf(extra, "%s + %s", 
			RCN_fetch(2, r32 >> 2), RCN_fetch(0, rIndex >> 0));
		return;
	}
void TLCS900h_disassemble_dst(void)
{
	second = get8_dis();	//Get the second opcode

	if (decode[second])
		(*decode[second])();
	else
		sprintf(instr, "unknown dst instr. %02X", second);
}
Esempio n. 4
0
static void EI()
{
	uint8 value = get8_dis();

	if (value == 7)
		sprintf(instr, "DI");
	else
		sprintf(instr, "EI %d", value);
}
Esempio n. 5
0
char* TLCS900h_disassemble(void)
{
	char str[80];
	unsigned int i;

	memset(str, 0, 80);
	
	//Reset
	bcnt = 0;
	brCode = FALSE;
	sprintf(instr, "unknown");
	sprintf(extra, "unknown");

	//Fix big addresses
	pc &= 0xFFFFFF;

	//Add the program counter
	sprintf(str, "%06X: ", pc);

	first = get8_dis();	//Get the first opcode

	//Disassemble
	if (decode[first])
	{
		//Decode any extra data
		TLCS900h_disassemble_extra();
		(*decode[first])();
	}

	//Add the instruction
	strcat(str, instr);

	//Add the bytes used
	for (i = strlen(str); i < 32; i++)
		str[i] = ' ';
	str[32] = '\"';
	for (i = 0; i < bcnt; i++)
	{
		char tmp[80];
		sprintf(tmp, "%02X ", bytes[i]);
		strcat(str, tmp);
	}
	str[strlen(str) - 1] = '\"';

	return strdup(str);
}
Esempio n. 6
0
static void LD8_8()
{
	uint8 dst = get8_dis(), src = get8_dis();
	sprintf(instr, "LD (0x%02X),0x%02X", dst, src);
}
Esempio n. 7
0
static void JR()
{
	sprintf(instr, "JR %s,0x%06X", ccName[first & 0xF], (int8)get8_dis() + pc);
}
static void ExXDEd()	{sprintf(extra, "XDE %+d", (int8)get8_dis());}
Esempio n. 9
0
static void LDF()
{
	sprintf(instr, "LDF 0x%02X", get8_dis());
}
Esempio n. 10
0
static void LDB()
{
	sprintf(instr, "LD %s,0x%02X", gprName[first & 7][0], get8_dis());
}
Esempio n. 11
0
static void PUSH8()
{
	sprintf(instr, "PUSH 0x%02X", get8_dis());
}
Esempio n. 12
0
static void LD8_16()
{
	uint8 dst = get8_dis();
	uint16 src = get16_dis();
	sprintf(instr, "LD.w (0x%02X),0x%04X", dst, src);
}
static void ExXBCd()	{sprintf(extra, "XBC %+d", (int8)get8_dis());}
static void ExXHLd()	{sprintf(extra, "XHL %+d", (int8)get8_dis());}
static void ExXIZd()	{sprintf(extra, "XIZ %+d", (int8)get8_dis());}
static void Ex8()		{sprintf(extra, "0x%02X", get8_dis());}
static void ExXSPd()	{sprintf(extra, "XSP %+d", (int8)get8_dis());}
static void DST_LDBi(void)
{
	sprintf(instr, "LD (%s),0x%02X", extra, get8_dis());
}
static void ExXWAd()	{sprintf(extra, "XWA %+d", (int8)get8_dis());}