static UINT16 fetch16(void)
{
	UINT16 w;
	w = (cpu_readop(mem_offset) << 8) | (cpu_readop(mem_offset+1));
	mem_offset+=2;
	return w;
}
Beispiel #2
0
static	void illegal(void)
{
#if VERBOSE
	UINT16 pc = I.PC.w.l - 1;
	LOG(("i8085 illegal instruction %04X $%02X\n", pc, cpu_readop(pc)));
#endif
}
Beispiel #3
0
unsigned s2650_dasm(char *buffer, unsigned pc)
{
#ifdef MAME_DEBUG
    return Dasm2650(buffer,pc);
#else
	sprintf( buffer, "$%02X", cpu_readop(pc) );
	return 1;
#endif
}
Beispiel #4
0
static offs_t h6280_dasm(char *buffer, offs_t pc)
{
#ifdef MAME_DEBUG
    return Dasm6280(buffer,pc);
#else
	sprintf( buffer, "$%02X", cpu_readop(pc) );
	return 1;
#endif
}
Beispiel #5
0
static int tms7000_exl_execute(int cycles)
{
	int op;

	tms7000_icount = cycles;
	tms7000_div_by_16_trigger += cycles;

	do
	{
		CALL_MAME_DEBUG;

		if( tms7000.idle_state == 0 )
		{

			op = cpu_readop(pPC++);

			opfn_exl[op]();
		}
		else
			tms7000_icount -= 16;

		/* Internal timer system */

		while( tms7000_icount < tms7000_div_by_16_trigger )
		{
			tms7000_div_by_16_trigger -= 16;

			if( (tms7000.pf[0x03] & 0x80) == 0x80 ) /* Is timer system active? */
			{
				if( (tms7000.pf[0x03] & 0x40) != 0x40) /* Is system clock (divided by 16) the timer source? */
					tms7000_service_timer1();
			}
		}

	} while( tms7000_icount > 0 );

	tms7000_div_by_16_trigger -= tms7000_icount;
	return cycles - tms7000_icount;
}
Beispiel #6
0
static UINT8 ROP(void)
{
	return cpu_readop(I.PC.w.l++);
}
Beispiel #7
0
static INLINE int m4510_cpu_readop(void)
{
	register UINT16 t=m4510.pc.w.l++;
	return cpu_readop(M4510_MEM(t));
}
Beispiel #8
0
unsigned Dasm680x (int subtype, char *buf, unsigned pc)
{
	int invalid_mask;
	int code = cpu_readop(pc);
	const char *symbol, *symbol2;
	UINT8 opcode, args, access, size, invalid;

	switch( subtype )
	{
		case 6800: case 6802: case 6808:
			invalid_mask = 1;
			break;
		case 6801: case 6803:
			invalid_mask = 2;
			break;
		default:
			invalid_mask = 4;
	}

	opcode = table[code][0];
	args = table[code][1];
	access = table[code][2];
	size = table[code][3];
	invalid = table[code][4];

	if ( invalid & invalid_mask )	/* invalid for this cpu type ? */
	{
		strcpy(buf, "illegal");
		return 1;
	}

	buf += sprintf(buf, "%-5s", op_name_str[opcode]);

	switch( args )
	{
		case rel:  /* relative */
			symbol = set_ea_info( 0, pc, (INT8)ARG1 + 2, access );
			sprintf (buf, "%s", symbol);
			return 2;
		case imm:  /* immediate (byte or word) */
			if( size == B )
			{
				symbol = set_ea_info( 0, ARG1, EA_UINT8, EA_VALUE );
				sprintf (buf, "#%s", symbol);
                return 2;
			}
			symbol = set_ea_info( 0, ARGW, EA_UINT16, EA_VALUE );
			sprintf (buf, "#%s", symbol);
			return 3;
		case idx:  /* indexed + byte offset */
			symbol = set_ea_info( 1, ARG1, EA_UINT8, EA_VALUE );
			symbol2 = set_ea_info( 0, (m6800_get_reg(M6800_X) + ARG1), size, access);
			sprintf (buf, "(x+%s)", symbol );
            return 2;
		case imx:  /* immediate, indexed + byte offset */
			symbol = set_ea_info( 1, ARG1, EA_UINT8, EA_VALUE);
			symbol2 = set_ea_info( 0, (m6800_get_reg(M6800_X) + ARG2), size, access);
			sprintf (buf, "#%s,(x+$%02x)", symbol, ARG2 );
			return 3;
		case dir:  /* direct address */
			symbol = set_ea_info( 1, ARG1, size, access);
			sprintf (buf, "%s", symbol );
			return 2;
		case imd:  /* immediate, direct address */
            symbol = set_ea_info( 1, ARG1, EA_UINT8, EA_VALUE );
			symbol2 = set_ea_info( 0, ARG2, size, access);
			sprintf (buf, "#%s,%s", symbol, symbol2);
            return 3;
		case ext:  /* extended address */
			symbol = set_ea_info( 0, ARGW, size, access);
			sprintf (buf, "%s", symbol);
			return 3;
		case sx1:  /* byte from address (s + 1) */
			symbol = set_ea_info( 0, m6800_get_reg(M6800_S) + 1, EA_UINT8, access);
            sprintf (buf, "(s+1)");
            return 1;
        default:
			return 1;
	}
}
static UINT8 fetch(void)
{
	return cpu_readop(mem_offset++);
}
Beispiel #10
0
unsigned s2650_dasm(char *buffer, unsigned pc)
{
	sprintf( buffer, "$%02X", cpu_readop(pc) );
	return 1;
}
Beispiel #11
0
OP(illegal,2)
{
	logerror("Z180 #%d ill. opcode $ed $%02x\n",
			cpu_getactivecpu(), cpu_readop((_PCD-1)&0xffff));
}

/**********************************************************
 * special opcodes (ED prefix)
 **********************************************************/
OP(ed,00) { unsigned n = ARG(); _B = IN( n );						} /* IN0  B,(n) 	  */
OP(ed,01) { unsigned n = ARG(); OUT( n, _B );						} /* OUT0 (n),B 	  */
OP(ed,02) { illegal_2();											} /* DB   ED		  */
OP(ed,03) { illegal_2();											} /* DB   ED		  */
OP(ed,04) { TST( _B );												} /* TST  B 		  */
OP(ed,05) { illegal_2();											} /* DB   ED		  */
OP(ed,06) { illegal_2();											} /* DB   ED		  */
OP(ed,07) { illegal_2();											} /* DB   ED		  */

OP(ed,08) { unsigned n = ARG(); _C = IN( n );						} /* IN0  C,(n) 	  */
OP(ed,09) { unsigned n = ARG(); OUT( n, _C );						} /* OUT0 (n),C 	  */
OP(ed,0a) { illegal_2();											} /* DB   ED		  */
OP(ed,0b) { illegal_2();											} /* DB   ED		  */
OP(ed,0c) { TST( _C );												} /* TST  C 		  */
OP(ed,0d) { illegal_2();											} /* DB   ED		  */
OP(ed,0e) { illegal_2();											} /* DB   ED		  */
OP(ed,0f) { illegal_2();											} /* DB   ED		  */

OP(ed,10) { unsigned n = ARG(); _D = IN( n );						} /* IN0  D,(n) 	  */
OP(ed,11) { unsigned n = ARG(); OUT( n, _D );						} /* OUT0 (n),D 	  */
OP(ed,12) { illegal_2();											} /* DB   ED		  */
OP(ed,13) { illegal_2();											} /* DB   ED		  */
Beispiel #12
0
unsigned Dasm7000 (char *buffer, unsigned pc)
{
	int opcode, i, size = 1;
	const char *sym1;
	
	opcode = cpu_readop(pc++);

	for( i=0; i<sizeof(opcodes) / sizeof(opcodeinfo); i++ )
	{
		if( opcode == opcodes[i].opcode )
		{
			/* We found a match */
			
			int 			j,k,vector;
			UINT8	a;
			INT8	b;
			UINT16	c;
			INT16	d;

			buffer += sprintf (buffer, "%s", opcodes[i].name);

			j=opcodes[i].operand;
							
			for( k=0; k<4; k++ )
			{
				switch( of[j].decode[k] )
				{
					case DONE:
						return size;
					case NONE:
						buffer += sprintf (buffer, "%s", of[j].opstr[k]);
						break;
					case UI8:
						a = (UINT8)cpu_readop( pc++ );
						buffer += sprintf(buffer, of[j].opstr[k], (unsigned int)a);
						size += 1;
						break;
					case I8:
						b = (INT8)cpu_readop( pc++ );
						buffer += sprintf (buffer, of[j].opstr[k], (INT8)b);
						size += 1;
						break;
					case UI16:
						c = (UINT16)cpu_readop(pc++);
						c <<= 8;
						c += cpu_readop(pc++);
						buffer += sprintf (buffer, of[j].opstr[k], (unsigned int)c);
						size += 2;
						break;
					case I16:
						d = (INT16)cpu_readop(pc++);
						d <<= 8;
						d += cpu_readop(pc++);
						buffer += sprintf (buffer, of[j].opstr[k], (signed int)d);
						size += 2;
						break;
					case PCREL:
						b = (INT8)cpu_readop( pc++ );
						sym1 = set_ea_info(EA_DST, pc, b, EA_REL_PC);
						buffer += sprintf (buffer, of[j].opstr[k], sym1);
						size += 1;
						break;
					case PCABS:
						c = (UINT16)cpu_readop(pc++);
						c <<= 8;
						c += cpu_readop(pc++);
						sym1 = set_ea_info(EA_DST, c, EA_UINT16, EA_ABS_PC);
						buffer += sprintf (buffer, of[j].opstr[k], sym1);
						size += 2;
						break;
					case TRAP:
						vector = 0xffff - ((0xff - opcode) * 2);
						c = (UINT16)((cpu_readop( vector-1 ) << 8) + cpu_readop( vector ));
						sym1 = set_ea_info(EA_DST, c, EA_UINT16, EA_ABS_PC);
						break;
				}
			}

			return size;
		}
	}

	/* No Match */
	strcpy (buffer, "Illegal Opcode");
	return size;
}
Beispiel #13
0
static UINT8 fetchop(nec_state_t *nec_state)
{
	prefetch(nec_state);
	return cpu_readop(((Sreg(PS)<<4)+nec_state->ip++) ^ nec_state->fetch_xor);
}
Beispiel #14
0
static unsigned saturn_dasm(char *buffer, unsigned pc)
{
	sprintf( buffer, "$%X", cpu_readop(pc) );
	return 1;
}
Beispiel #15
0
unsigned lh5801_dasm(char *buffer, unsigned pc)
{
	sprintf( buffer, "$%X", cpu_readop(pc) );
	return 1;
}
Beispiel #16
0
unsigned tms7000_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram )
{
	int opcode, i, size = 1;
	int pos = 0;
	char tmpbuf[32];

	opcode = oprom[pos++];

	for( i=0; i<sizeof(opcodes) / sizeof(opcodeinfo); i++ )
	{
		if( opcode == opcodes[i].opcode )
		{
			/* We found a match */

			int 			j,k,vector;
			UINT8	a;
			INT8	b;
			UINT16	c;
			INT16	d;

			buffer += sprintf (buffer, "%s", opcodes[i].name);

			j=opcodes[i].operand;

			for( k=0; k<4; k++ )
			{
				switch( of[j].decode[k] )
				{
					case DONE:
						break;
					case NONE:
						buffer += sprintf (buffer, "%s", of[j].opstr[k]);
						break;
					case UI8:
						a = (UINT8)opram[pos++];
						buffer += sprintf(buffer, of[j].opstr[k], (unsigned int)a);
						size += 1;
						break;
					case I8:
						b = (INT8)opram[pos++];
						buffer += sprintf (buffer, of[j].opstr[k], (INT8)b);
						size += 1;
						break;
					case UI16:
						c = (UINT16)opram[pos++];
						c <<= 8;
						c += opram[pos++];
						buffer += sprintf (buffer, of[j].opstr[k], (unsigned int)c);
						size += 2;
						break;
					case I16:
						d = (INT16)opram[pos++];
						d <<= 8;
						d += opram[pos++];
						buffer += sprintf (buffer, of[j].opstr[k], (signed int)d);
						size += 2;
						break;
					case PCREL:
						b = (INT8)opram[pos++];
						sprintf(tmpbuf, "$%04X", pc+2+k);
						buffer += sprintf (buffer, of[j].opstr[k], tmpbuf);
						size += 1;
						break;
					case PCABS:
						c = (UINT16)opram[pos++];
						c <<= 8;
						c += opram[pos++];
						sprintf(tmpbuf, "$%04X", c);
						buffer += sprintf (buffer, of[j].opstr[k], tmpbuf);
						size += 2;
						break;
					case TRAP:
						vector = 0xffff - ((0xff - opcode) * 2);
						c = (UINT16)((cpu_readop( vector-1 ) << 8) + cpu_readop( vector ));
						break;
				}
			}
			return pos | opcodes[i].s_flag | DASMFLAG_SUPPORTED;
		}
	}

	/* No Match */
	strcpy (buffer, "Illegal Opcode");
	return pos | DASMFLAG_SUPPORTED;
}
Beispiel #17
0
/****************************************************************************
 * Disassemble opcode at PC and return number of bytes it takes
 ****************************************************************************/
unsigned DasmZ80( char *buffer, unsigned pc )
{
    z80dasm *d;
	const char *symbol, *src;
	const char *ixy;
	char *dst;
	unsigned PC = pc;
	INT8 offset = 0;
	UINT8 op, op1;
	UINT16 ea = 0, xy = 0;

	ixy = "oops!!";
	dst = buffer;
	symbol = NULL;

	op = cpu_readop( pc++ );
    op1 = 0; /* keep GCC happy */

    switch (op)
	{
	case 0xcb:
		op = cpu_readop(pc++);
        d = &mnemonic_cb[op];
		break;
	case 0xed:
		op1 = cpu_readop(pc++);
        d = &mnemonic_ed[op1];
		break;
	case 0xdd:
		ixy = "ix";
		op1 = cpu_readop(pc++);
		if( op1 == 0xcb )
		{
			offset = (INT8) cpu_readop_arg(pc++);
			op1 = cpu_readop_arg(pc++); /* fourth byte from OP_RAM! */
			xy = z80_get_reg( Z80_IX );
			ea = (xy + offset) & 0xffff;
			d = &mnemonic_xx_cb[op1];
		}
		else d = &mnemonic_xx[op1];
        break;
	case 0xfd:
		ixy = "iy";
		op1 = cpu_readop(pc++);
		if( op1 == 0xcb )
		{
			offset = (INT8) cpu_readop_arg(pc++);
			op1 = cpu_readop_arg(pc++); /* fourth byte from OP_RAM! */
			xy = z80_get_reg( Z80_IY );
			ea = (ea + offset) & 0xffff;
			d = &mnemonic_xx_cb[op1];
		}
		else d = &mnemonic_xx[op1];
        break;
	default:
		d = &mnemonic_main[op];
		break;
	}

    if( d->arguments )
	{
		dst += sprintf(dst, "%-4s ", s_mnemonic[d->mnemonic]);
		src = d->arguments;
		while( *src )
		{
			switch( *src )
			{
			case '?':   /* illegal opcode */
				dst += sprintf( dst, "$%02x,$%02x", op, op1);
				break;
			case 'A':
				ea = cpu_readop_arg(pc) + ( cpu_readop_arg((pc+1)&0xffff) << 8);
				pc += 2;
				symbol = set_ea_info(0, ea, EA_UINT16, d->access);
				dst += sprintf( dst, "%s", symbol );
                break;
            case 'B':   /* Byte op arg */
				ea = cpu_readop_arg( pc++ );
				symbol = set_ea_info(1, ea, EA_UINT8, EA_VALUE);
				dst += sprintf( dst, "%s", symbol );
				break;
			case '(':   /* Memory byte at (HL) */
                *dst++ = *src;
				if( !strncmp( src, "(bc)", 4) )
				{
					ea = z80_get_reg( Z80_BC );
					set_ea_info(0, ea, EA_UINT8, d->access);
				}
                else
				if( !strncmp( src, "(de)", 4) )
				{
					ea = z80_get_reg( Z80_DE );
					set_ea_info(0, ea, EA_UINT8, d->access);
                }
                else
                if( !strncmp( src, "(hl)", 4) )
				{
					ea = z80_get_reg( Z80_HL );
					if( d->access == EA_ABS_PC )
						set_ea_info(0, ea, EA_DEFAULT, EA_ABS_PC);
					else
						set_ea_info(0, ea, EA_UINT8, d->access);
                }
				else
				if( !strncmp( src, "(sp)", 4) )
				{
					ea = z80_get_reg( Z80_SP );
					set_ea_info(0, ea, EA_UINT16, d->access);
                }
				else
				if( !strncmp( src, "(P)", 3) )
				{
					ea = (z80_get_reg( Z80_AF ) & 0xff00) | cpu_readop_arg( pc );
                    set_ea_info(0, ea, EA_UINT16, d->access);
                }
                else
                if( !strncmp( src, "(c)", 3) )
				{
					ea = z80_get_reg( Z80_BC );
					set_ea_info(0, ea, EA_UINT16, d->access);
                }
                else
				if( !strncmp( src, "(I)", 3) )
				{
					ea = xy;
					set_ea_info(0, ea, EA_DEFAULT, d->access);
                }
                break;
			case 'N':   /* Immediate 16 bit */
				ea = cpu_readop_arg(pc) + ( cpu_readop_arg((pc+1)&0xffff) << 8 );
				pc += 2;
				symbol = set_ea_info(1, ea, EA_UINT16, EA_VALUE );
				dst += sprintf( dst, "%s", symbol );
                break;
			case 'O':   /* Offset relative to PC */
				offset = (INT8) cpu_readop_arg(pc++);
				symbol = set_ea_info(0, PC, offset + 2, d->access);
				dst += sprintf( dst, "%s", symbol );
				break;
			case 'P':   /* Port number */
				ea = cpu_readop_arg( pc++ );
				dst += sprintf( dst, "$%02X", ea );
                break;
            case 'V':   /* Restart vector */
				ea = op & 0x38;
				symbol = set_ea_info(0, ea, EA_UINT8, d->access);
				dst += sprintf( dst, "%s", symbol );
				break;
			case 'W':   /* Memory address word */
				ea = cpu_readop_arg(pc) + ( cpu_readop_arg((pc+1)&0xffff) << 8);
				pc += 2;
				symbol = set_ea_info(0, ea, EA_UINT16, d->access);
				dst += sprintf( dst, "%s", symbol );
				break;
			case 'X':
				offset = (INT8) cpu_readop_arg(pc++);
                ea = (xy + offset) & 0xffff;
            case 'Y':
				symbol = set_ea_info(0, ea, EA_UINT8, d->access);
				dst += sprintf( dst,"(%s%c$%02x)", ixy, sign(offset), offs(offset) );
				break;
			case 'I':
				dst += sprintf( dst, "%s", ixy);
				break;
			default:
				*dst++ = *src;
			}
			src++;
		}
		*dst = '\0';
	}
	else
	{
		dst += sprintf(dst, "%s", s_mnemonic[d->mnemonic]);
    }

    return pc - PC;
}
Beispiel #18
0
static INLINE UINT8 READ_OP(void) 
{
	return cpu_readop(sc61860.pc++);
}
Beispiel #19
0
/***************************************************************
 * ROP
 * read next opcode
 ***************************************************************/
INLINE UINT8 ROP(void)
{
	UINT8 result = cpu_readop(S.page + S.iar);
	S.iar = (S.iar + 1) & PMSK;
	return result;
}
Beispiel #20
0
static INLINE UINT16 READ_OP_ARG_WORD(void)
{
	UINT16 t=cpu_readop(sc61860.pc++)<<8;
	t|=cpu_readop(sc61860.pc++);
	return t;
}
Beispiel #21
0
unsigned DasmF8(char *buffer, unsigned pc)
{
	UINT8 op = cpu_readop(pc);
	UINT16 ea;
	unsigned size = 1;
	const char *sym, *sym2;

    switch( op )
	{
	/* opcode  bitmask */
	case 0x00: /* 0000 0000 */
		sym = set_ea_info( 0, 12, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,KU");
		break;
	case 0x01: /* 0000 0001 */
		sym = set_ea_info( 0, 13, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,KL");
		break;
	case 0x02: /* 0000 0010 */
		sym = set_ea_info( 0, 14, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,QU");
		break;
	case 0x03: /* 0000 0011 */
		sym = set_ea_info( 0, 15, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,QL");
		break;
	case 0x04: /* 0000 0100 */
		sym = set_ea_info( 0, 12, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   KU,A");
		break;
	case 0x05: /* 0000 0101 */
		sym = set_ea_info( 0, 13, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   KL,A");
		break;
	case 0x06: /* 0000 0110 */
		sym = set_ea_info( 0, 14, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   QU,A");
		break;
	case 0x07: /* 0000 0111 */
		sym = set_ea_info( 0, 15, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   QL,A");
		break;

    case 0x08: /* 0000 1000 */
		sym = set_ea_info( 0, 12, EA_UINT16, EA_ZPG_WR );
        sprintf(buffer, "LR   K,P");
		break;
	case 0x09: /* 0000 1001 */
		sym = set_ea_info( 0, 12, EA_UINT16, EA_ZPG_RD );
        sprintf(buffer, "LR   P,K");
		break;
	case 0x0a: /* 0000 1010 */
		sprintf(buffer, "LR   A,IS");
		break;
	case 0x0b: /* 0000 1011 */
		sprintf(buffer, "LR   IS,A");
		break;

    case 0x0c: /* 0000 1100 */
		sprintf(buffer, "PK") ;
		break;
	case 0x0d: /* 0000 1101 */
		sprintf(buffer, "LR   P0,Q");
		sym = set_ea_info( 0, 14, EA_UINT16, EA_ZPG_RD );
        break;
	case 0x0e: /* 0000 1110 */
		sym = set_ea_info( 0, 14, EA_UINT16, EA_ZPG_WR );
        sprintf(buffer, "LR   Q,DC");
		break;
	case 0x0f: /* 0000 1111 */
		sym = set_ea_info( 0, 14, EA_UINT16, EA_ZPG_RD );
        sprintf(buffer, "LR   DC,Q");
		break;
	case 0x10: /* 0001 0000 */
		sym = set_ea_info( 0, 10, EA_UINT16, EA_ZPG_RD );
		sprintf(buffer, "LR   DC,H");
		break;
	case 0x11: /* 0001 0001 */
		sym = set_ea_info( 0, 10, EA_UINT16, EA_ZPG_WR );
		sprintf(buffer, "LR   H,DC");
		break;
	case 0x12: /* 0001 0010 */
		sprintf(buffer, "SR   1");
		break;
	case 0x13: /* 0001 0011 */
		sprintf(buffer, "SL   1");
		break;
	case 0x14: /* 0001 0100 */
		sprintf(buffer, "SR   4");
		break;
	case 0x15: /* 0001 0101 */
		sprintf(buffer, "SL   4");
		break;
	case 0x16: /* 0001 0110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_DC0), EA_UINT8, EA_MEM_RD );
		sprintf(buffer, "LM") ;
		break;
	case 0x17: /* 0001 0111 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_DC0), EA_UINT8, EA_MEM_WR );
		sprintf(buffer, "ST");
		break;
	case 0x18: /* 0001 1000 */
		sprintf(buffer, "COM");
		break;
	case 0x19: /* 0001 1001 */
		sprintf(buffer, "LNK");
		break;
	case 0x1a: /* 0001 1010 */
		sprintf(buffer, "DI");
		break;
	case 0x1b: /* 0001 1011 */
		sprintf(buffer, "EI");
		break;
	case 0x1c: /* 0001 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_PC1), EA_UINT16, EA_ABS_PC );
        sprintf(buffer, "POP");
		break;
	case 0x1d: /* 0001 1101 */
		sym = set_ea_info( 0, 9, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   W,J");
		break;
	case 0x1e: /* 0001 1110 */
		sym = set_ea_info( 0, 9, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   J,W");
		break;
	case 0x1f: /* 0001 1111 */
		sprintf(buffer, "INC");
		break;
	case 0x20: /* 0010 0000 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "LI   %s",sym);
		break;
	case 0x21: /* 0010 0001 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "NI   %s",sym);
        break;
    case 0x22: /* 0010 0010 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "OI   %s",sym);
        break;
    case 0x23: /* 0010 0011 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "XI   %s",sym);
        break;
	case 0x24: /* 0010 0100 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "AI   %s",sym);
        break;
	case 0x25: /* 0010 0101 */
		size += 1;
        sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_VALUE );
		sprintf(buffer, "CI   %s",sym);
        break;
	case 0x26: /* 0010 0110 */
		size += 1;
		sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_PORT_RD );
		sprintf(buffer, "IN   %s",sym);
        break;
	case 0x27: /* 0010 0111 */
		size += 1;
		sym = set_ea_info( 0, cpu_readop_arg(pc+1), EA_UINT8, EA_PORT_WR );
		sprintf(buffer, "OUT  %s",sym);
        break;
	case 0x28: /* 0010 1000 */
		size += 2;
        ea = cpu_readop_arg(pc+1) << 8;
        ea |= cpu_readop_arg(pc+2);
		sym = set_ea_info( 0, ea, EA_UINT16, EA_ABS_PC );
		sprintf(buffer, "PI   %s",sym);
        break;
	case 0x29: /* 0010 1001 */
		size += 2;
        ea = cpu_readop_arg(pc+1) << 8;
        ea |= cpu_readop_arg(pc+2);
		sym = set_ea_info( 0, ea, EA_UINT16, EA_ABS_PC );
		sprintf(buffer, "JMP  %s",sym);
        break;
	case 0x2a: /* 0010 1010 */
		size += 2;
        ea = cpu_readop_arg(pc+1) << 8;
        ea |= cpu_readop_arg(pc+2);
		sym = set_ea_info( 0, ea, EA_UINT16, EA_VALUE );
		sprintf(buffer, "DCI  %s",sym);
        break;
	case 0x2b: /* 0010 1011 */
		sprintf(buffer, "NOP");
		break;
	case 0x2c: /* 0010 1100 */
		sprintf(buffer, "XDC");
		break;
	case 0x2d: /* 0010 1101 */
	case 0x2e: /* 0010 1110 */
	case 0x2f: /* 0010 1111 */
		sprintf(buffer, "???  $%02X",op);
        break;

    case 0x30: /* 0011 0000 */
	case 0x31: /* 0011 0001 */
	case 0x32: /* 0011 0010 */
	case 0x33: /* 0011 0011 */
	case 0x34: /* 0011 0100 */
	case 0x35: /* 0011 0101 */
	case 0x36: /* 0011 0110 */
	case 0x37: /* 0011 0111 */
	case 0x38: /* 0011 1000 */
	case 0x39: /* 0011 1001 */
	case 0x3a: /* 0011 1010 */
	case 0x3b: /* 0011 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RDWR );
        sprintf(buffer, "DS   %s",rname[op & 15]);
        break;
    case 0x3c: /* 0011 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RDWR );
        sprintf(buffer, "DS   (IS)");
        break;
    case 0x3d: /* 0011 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RDWR );
        sprintf(buffer, "DS   (IS++)");
        break;
    case 0x3e: /* 0011 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RDWR );
        sprintf(buffer, "DS   (IS--)");
        break;
    case 0x3f: /* 0011 1111 */
		sprintf(buffer, "???  $%02X",op);
        break;

    case 0x40: /* 0100 0000 */
    case 0x41: /* 0100 0001 */
	case 0x42: /* 0100 0010 */
	case 0x43: /* 0100 0011 */
	case 0x44: /* 0100 0100 */
	case 0x45: /* 0100 0101 */
	case 0x46: /* 0100 0110 */
	case 0x47: /* 0100 0111 */
	case 0x48: /* 0100 1000 */
	case 0x49: /* 0100 1001 */
	case 0x4a: /* 0100 1010 */
	case 0x4b: /* 0100 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,%s",rname[op & 15]);
        break;
    case 0x4c: /* 0100 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,(IS)");
        break;
    case 0x4d: /* 0100 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,(IS++)");
        break;
    case 0x4e: /* 0100 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "LR   A,(IS--)");
        break;
    case 0x4f: /* 0100 1111 */
		sprintf(buffer, "???  $%02X",op);
        break;

    case 0x50: /* 0101 0000 */
	case 0x51: /* 0101 0001 */
	case 0x52: /* 0101 0010 */
	case 0x53: /* 0101 0011 */
	case 0x54: /* 0101 0100 */
	case 0x55: /* 0101 0101 */
	case 0x56: /* 0101 0110 */
	case 0x57: /* 0101 0111 */
	case 0x58: /* 0101 1000 */
	case 0x59: /* 0101 1001 */
	case 0x5a: /* 0101 1010 */
	case 0x5b: /* 0101 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   %s,A",rname[op & 15]);
        break;
    case 0x5c: /* 0101 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   (IS),A");
        break;
    case 0x5d: /* 0101 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   (IS++),A");
        break;
    case 0x5e: /* 0101 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_WR );
        sprintf(buffer, "LR   (IS--),A");
        break;
    case 0x5f: /* 0101 1111 */
		sprintf(buffer, "???  $%02X",op);
        break;

    case 0x60: /* 0110 0000 */
    case 0x61: /* 0110 0001 */
	case 0x62: /* 0110 0010 */
	case 0x63: /* 0110 0011 */
	case 0x64: /* 0110 0100 */
	case 0x65: /* 0110 0101 */
	case 0x66: /* 0110 0110 */
	case 0x67: /* 0110 0111 */
		sym = set_ea_info( 0, op & 7, EA_UINT8, EA_VALUE );
		sprintf(buffer, "LISU %s", sym);
		break;
    case 0x68: /* 0110 1000 */
	case 0x69: /* 0110 1001 */
	case 0x6a: /* 0110 1010 */
	case 0x6b: /* 0110 1011 */
	case 0x6c: /* 0110 1100 */
	case 0x6d: /* 0110 1101 */
	case 0x6e: /* 0110 1110 */
	case 0x6f: /* 0110 1111 */
		sym = set_ea_info( 0, op & 7, EA_UINT8, EA_VALUE );
		sprintf(buffer, "LISL %s", sym);
        break;

    case 0x70: /* 0111 0000 */
	case 0x71: /* 0111 0001 */
	case 0x72: /* 0111 0010 */
	case 0x73: /* 0111 0011 */
	case 0x74: /* 0111 0100 */
	case 0x75: /* 0111 0101 */
	case 0x76: /* 0111 0110 */
	case 0x77: /* 0111 0111 */
	case 0x78: /* 0111 1000 */
	case 0x79: /* 0111 1001 */
	case 0x7a: /* 0111 1010 */
	case 0x7b: /* 0111 1011 */
	case 0x7c: /* 0111 1100 */
	case 0x7d: /* 0111 1101 */
	case 0x7e: /* 0111 1110 */
	case 0x7f: /* 0111 1111 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_VALUE );
		sprintf(buffer, "LIS  %s", sym);
		break;

    case 0x80: /* 1000 0000 */
	case 0x81: /* 1000 0001 */
	case 0x82: /* 1000 0010 */
	case 0x83: /* 1000 0011 */
	case 0x84: /* 1000 0100 */
	case 0x85: /* 1000 0101 */
	case 0x86: /* 1000 0110 */
	case 0x87: /* 1000 0111 */
		size += 1;
		sym = set_ea_info( 0, op & 7, EA_UINT8, EA_VALUE );
		ea = pc + (INT32)(INT16)(INT8)cpu_readop_arg(pc+1) - 3;
		sym2 = set_ea_info( 1, ea, EA_UINT16, EA_REL_PC );
		sprintf(buffer, "BT   %s,%s", sym, sym2);
        break;

    case 0x88: /* 1000 1000 */
		sprintf(buffer, "AM");
		break;

    case 0x89: /* 1000 1001 */
		sprintf(buffer, "AMD");
        break;

    case 0x8a: /* 1000 1010 */
		sprintf(buffer, "NM");
		break;

    case 0x8b: /* 1000 1011 */
		sprintf(buffer, "OM");
		break;

    case 0x8c: /* 1000 1100 */
		sprintf(buffer, "XM");
		break;

    case 0x8d: /* 1000 1101 */
		sprintf(buffer, "CM");
		break;

    case 0x8e: /* 1000 1110 */
		sprintf(buffer, "ADC");
        break;

    case 0x8f: /* 1000 1111 */
		size += 1;
		ea = pc + (INT8)cpu_readop_arg(pc+1) - 3;
		sym = set_ea_info( 0, ea, EA_UINT16, EA_REL_PC );
		sprintf(buffer, "BR7  %s", sym);
        break;

    case 0x90: /* 1001 0000 */
	case 0x91: /* 1001 0001 */
	case 0x92: /* 1001 0010 */
	case 0x93: /* 1001 0011 */
	case 0x94: /* 1001 0100 */
	case 0x95: /* 1001 0101 */
	case 0x96: /* 1001 0110 */
	case 0x97: /* 1001 0111 */
	case 0x98: /* 1001 1000 */
	case 0x99: /* 1001 1001 */
	case 0x9a: /* 1001 1010 */
	case 0x9b: /* 1001 1011 */
	case 0x9c: /* 1001 1100 */
	case 0x9d: /* 1001 1101 */
	case 0x9e: /* 1001 1110 */
	case 0x9f: /* 1001 1111 */
		size += 1;
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_VALUE );
		ea = pc + (INT8)cpu_readop_arg(pc+1) - 3;
        sym2 = set_ea_info( 1, ea, EA_UINT16, EA_REL_PC );
		sprintf(buffer, "BF   %s,%s", sym, sym2);
        break;

    case 0xa0: /* 1010 0000 */
	case 0xa1: /* 1010 0001 */
		sym = set_ea_info( 0, op & 15, EA_INT8, EA_PORT_RD );
		sprintf(buffer, "INS  %s", sym);
        break;

    case 0xa2: /* 1010 0010 */
	case 0xa3: /* 1010 0011 */
		sprintf(buffer, "???  $%02X\n", op);
        break;

    case 0xa4: /* 1010 0100 */
	case 0xa5: /* 1010 0101 */
	case 0xa6: /* 1010 0110 */
	case 0xa7: /* 1010 0111 */
	case 0xa8: /* 1010 1000 */
	case 0xa9: /* 1010 1001 */
	case 0xaa: /* 1010 1010 */
	case 0xab: /* 1010 1011 */
	case 0xac: /* 1010 1100 */
	case 0xad: /* 1010 1101 */
	case 0xae: /* 1010 1110 */
	case 0xaf: /* 1010 1111 */
		sym = set_ea_info( 0, op & 15, EA_INT8, EA_PORT_RD );
		sprintf(buffer, "INS  %s", sym);
        break;

    case 0xb0: /* 1011 0000 */
	case 0xb1: /* 1011 0001 */
		sym = set_ea_info( 0, op & 15, EA_INT8, EA_PORT_WR );
		sprintf(buffer, "OUTS %s", sym);
        break;

    case 0xb2: /* 1011 0010 */
	case 0xb3: /* 1011 0011 */
		sprintf(buffer, "???  $%02X\n", op);
        break;

    case 0xb4: /* 1011 0100 */
	case 0xb5: /* 1011 0101 */
	case 0xb6: /* 1011 0110 */
	case 0xb7: /* 1011 0111 */
	case 0xb8: /* 1011 1000 */
	case 0xb9: /* 1011 1001 */
	case 0xba: /* 1011 1010 */
	case 0xbb: /* 1011 1011 */
	case 0xbc: /* 1011 1100 */
	case 0xbd: /* 1011 1101 */
	case 0xbe: /* 1011 1110 */
	case 0xbf: /* 1011 1111 */
		sym = set_ea_info( 0, op & 15, EA_INT8, EA_PORT_WR );
		sprintf(buffer, "OUTS %s", sym);
        break;

    case 0xc0: /* 1100 0000 */
	case 0xc1: /* 1100 0001 */
	case 0xc2: /* 1100 0010 */
	case 0xc3: /* 1100 0011 */
	case 0xc4: /* 1100 0100 */
	case 0xc5: /* 1100 0101 */
	case 0xc6: /* 1100 0110 */
	case 0xc7: /* 1100 0111 */
	case 0xc8: /* 1100 1000 */
	case 0xc9: /* 1100 1001 */
	case 0xca: /* 1100 1010 */
	case 0xcb: /* 1100 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RD );
        sprintf(buffer, "AS   %s", rname[op & 15]);
        break;
    case 0xcc: /* 1100 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "AS   (IS)");
        break;
    case 0xcd: /* 1100 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "AS   (IS++)");
        break;
    case 0xce: /* 1100 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "AS   (IS--)");
        break;
    case 0xcf: /* 1100 1111 */
		sprintf(buffer, "???  $%02X\n", op);
		break;

    case 0xd0: /* 1101 0000 */
	case 0xd1: /* 1101 0001 */
	case 0xd2: /* 1101 0010 */
	case 0xd3: /* 1101 0011 */
	case 0xd4: /* 1101 0100 */
	case 0xd5: /* 1101 0101 */
	case 0xd6: /* 1101 0110 */
	case 0xd7: /* 1101 0111 */
	case 0xd8: /* 1101 1000 */
	case 0xd9: /* 1101 1001 */
	case 0xda: /* 1101 1010 */
	case 0xdb: /* 1101 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "ASD  %s", rname[op & 15]);
		break;
    case 0xdc: /* 1101 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "ASD  (IS)");
		break;
    case 0xdd: /* 1101 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "ASD  (IS++)");
        break;
    case 0xde: /* 1101 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "ASD  (IS--)");
        break;
    case 0xdf: /* 1101 1111 */
		sprintf(buffer, "???  $%02X\n", op);
        break;

    case 0xe0: /* 1110 0000 */
	case 0xe1: /* 1110 0001 */
	case 0xe2: /* 1110 0010 */
	case 0xe3: /* 1110 0011 */
	case 0xe4: /* 1110 0100 */
	case 0xe5: /* 1110 0101 */
	case 0xe6: /* 1110 0110 */
	case 0xe7: /* 1110 0111 */
	case 0xe8: /* 1110 1000 */
	case 0xe9: /* 1110 1001 */
	case 0xea: /* 1110 1010 */
	case 0xeb: /* 1110 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "XS   %s", rname[op & 15]);
        break;
    case 0xec: /* 1110 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "XS   (IS)");
        break;
    case 0xed: /* 1110 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "XS   (IS++)");
        break;
    case 0xee: /* 1110 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "XS   (IS--)");
        break;
    case 0xef: /* 1110 1111 */
		sprintf(buffer, "???  $%02X\n", op);
        break;


    case 0xf0: /* 1111 0000 */
	case 0xf1: /* 1111 0001 */
	case 0xf2: /* 1111 0010 */
	case 0xf3: /* 1111 0011 */
	case 0xf4: /* 1111 0100 */
	case 0xf5: /* 1111 0101 */
	case 0xf6: /* 1111 0110 */
	case 0xf7: /* 1111 0111 */
	case 0xf8: /* 1111 1000 */
	case 0xf9: /* 1111 1001 */
	case 0xfa: /* 1111 1010 */
	case 0xfb: /* 1111 1011 */
		sym = set_ea_info( 0, op & 15, EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "NS   %s", rname[op & 15]);
		break;
    case 0xfc: /* 1111 1100 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "NS   (IS)");
        break;
    case 0xfd: /* 1111 1101 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "NS   (IS++)");
        break;
    case 0xfe: /* 1111 1110 */
		sym = set_ea_info( 0, activecpu_get_reg(F8_IS), EA_UINT8, EA_ZPG_RD );
		sprintf(buffer, "NS   (IS--)");
        break;
    case 0xff: /* 1111 1111 */
		sprintf(buffer, "???  $%02X\n", op);
        break;
    }

    return size;
}
Beispiel #22
0
INLINE int READ_OP(void)
{
	saturn_ICount-=3;
	return cpu_readop(saturn.pc++);
}