printf("\t_%s@%d\t\t; %04X\n", func_table[func], ptrc[3], func);
printf("\t_%s@%d (%04X)\n", func_table[func], ptrc[3], func);
unsigned short print_opcode(unsigned char* ptrc, unsigned short coffset,	unsigned char* pdataseg,unsigned short* pextern,	unsigned short externsize, const char **func_table, int funsize){	unsigned short nbytes;	unsigned short i;	// Find the description	opcode_desc* pdesc = ( *ptrc >= ( sizeof(opcode_table) / sizeof( opcode_desc ) ) ) ?							NULL : opcode_table + ( *ptrc );	if( pdesc && ( pdesc->mnemonic == NULL ) )	{		printf("Unknown opcode: %x\n",*ptrc);		// Unknown opcode		pdesc = NULL;	}	// Number of bytes to print	nbytes = pdesc ? ( pdesc->nbytes + 1 ) : 1;	// Print label	printf("%04X: ", coffset);	// Print bytes	for( i = 0; i < nbytes; i++ )		printf("%02X ", ptrc[i]);	// Print mnemonic	if( nbytes < 4 )		printf("\t");        if (pdesc)		printf("\t%s", pdesc->mnemonic);	else		printf("\tdb %x\t???",ptrc[0]);	// Print operands if any	if( ( nbytes == 1 ) || ( pdesc == NULL && pdesc->type == 0) )	{		printf("\n");		return nbytes;	}	switch( pdesc->type )	{	case BYTE:		printf("\t%x\n",*(unsigned char*)(ptrc+1));		break;	case PUSH:		for ( i = 1; i < nbytes; i++)			printf("\n%04X:\t\t\tdb %x",coffset+i,ptrc[i]);		printf("\n");		break;	case IMMED:		// Print immediate operand		printf("\t%04XH\t\t\t; %d\n", *(unsigned short*)( ptrc + 1 ), *(short*)( ptrc + 1 ));		break;	case DATA_STRING:		{			unsigned char* pstr;			int len;			// Print data string operand			pstr = pdataseg + *(unsigned short*)( ptrc + 1 );			len = strlen(pstr);			if( len > 20 )				len = 20 - 3;			printf("\tL%04X\t\t\t; ", *(unsigned short*)( ptrc + 1 ));			for( i = 0; i < len; i++ )				printf("%c", pstr[i]);			if( len < strlen(pstr) )				// String truncated				printf("...");			printf("\n");		}		break;	case RELATIVE_JUMP:		// Print jump desination//		printf("\t%04X\n", *(short*)( ptrc + 1 ) + (short)coffset + 3);		printf("\t%04X\n", *(short*)( ptrc + nbytes - 2) + 				(short)coffset + nbytes);// debugging printf("nbytes=%d, coffset=%d\n", nbytes, coffset);		break;	case SLOOP:  /* WJP */		printf("\t[%04X], %04X\n", *(unsigned short*)( ptrc + nbytes - 4 ),			   *(short*)( ptrc + nbytes - 2) + (short)coffset + nbytes);	case IMMED_AND_RELATIVE_JUMP:	/* JSF */		printf("\t%04XH, %04X\n", *(unsigned short*)( ptrc + 1 ),				*(short*)( ptrc + 3 ) + (short)coffset + 5);		break;	case CALL:		{			// Print call operand			unsigned short func = *(unsigned short*)( ptrc + 1 );			if( ( func < funsize ) &&				 func_table[func] )				// Known function				printf("\t_%s@%d\t\t; %04X\n", func_table[func], ptrc[3], func);			else				// Unknown function				printf("\t%04X, %d\n", func, ptrc[3]);		}		break;	case EXTCALL:		{			// Print extern call			unsigned short externpos = *(unsigned short*)( ptrc + 1 );			if( externpos < externsize )				printf("\t[%04X]\t\t\t; %04XH\n", externpos, pextern[externpos]);			else				printf("\t[%04X]\t\t\t; ????\n", externpos);		}		break;	case VARREF:		// Print variable reference		printf("\t[%04X]\n", *(unsigned short*)( ptrc + 1 ));		break;	case FLGREF:		// Print global flag reference		printf("\tflag:[%04X]\n", *(unsigned short*)( ptrc + 1 ));		break;	default:		// Unknown type		printf("\n");		break;	}	return nbytes;}