Esempio n. 1
0
UINT8 pic16c62x_device::GET_REGFILE(offs_t addr)    /* Read from internal memory */
{
	UINT8 data;

	if (addr == 0) {                        /* Indirect addressing  */
		addr = (FSR & m_picRAMmask);
	}

	switch(addr)
	{
		case 0x00:  /* Not an actual register, so return 0 */
		case 0x80:
					data = 0;
					break;
		case 0x02:
		case 0x03:
		case 0x0b:
		case 0x82:
		case 0x83:
		case 0x8b:
					data = M_RDRAM(addr & 0x7f);
					break;
		case 0x84:
		case 0x04:  data = (FSR | (UINT8)(~m_picRAMmask));
					break;
		case 0x05:  data = P_IN(0);
					data &= m_TRISA;
					data |= ((UINT8)(~m_TRISA) & PORTA);
					data &= 0x1f;       /* 5-bit port (only lower 5 bits used) */
					break;
		case 0x06:  data = P_IN(1);
					data &= m_TRISB;
					data |= ((UINT8)(~m_TRISB) & PORTB);
					break;
		case 0x8a:
		case 0x0a:  data = m_PCLATH;
					break;
		case 0x81:  data = m_OPTION;
					break;
		case 0x85:  data = m_TRISA;
					break;
		case 0x86:  data = m_TRISB;
					break;
		default:    data = M_RDRAM(addr);
					break;
	}
	return data;
}
Esempio n. 2
0
INLINE UINT8 GET_REGFILE(offs_t addr)	/* Read from internal memory */
{
	UINT8 data;

	if ((picmodel == 0x16C57) || (picmodel == 0x16C58))
	{
		addr |= (R.FSR & 0x60);		/* FSR used for banking */
	}
	if ((addr & 0x10) == 0) addr &= 0x0f;

	switch(addr)
	{
		case 00:	addr = (R.FSR & picRAMmask);
					if (addr == 0) { data = 0; break; }
					if ((addr & 0x10) == 0) addr &= 0x0f;
					data = R.picRAM[addr];			/* Indirect address */
					break;
		case 04:	data = (R.FSR | (~picRAMmask)); break;
		case 05:	data = P_IN(0);
					data &= R.TRISA;
					data |= (~R.TRISA & R.PORTA);
					data &= 0xf;		/* 4-bit port (only lower 4 bits used) */
					break;
		case 06:	data = P_IN(1);
					data &= R.TRISB;
					data |= (~R.TRISB & R.PORTB);
					break;
		case 07:	if ((picmodel == 0x16C55) || (picmodel == 0x16C57)) {
						data = P_IN(2);
						data &= R.TRISC;
						data |= (~R.TRISC & R.PORTC);
					}
					else {		/* PIC16C54, PIC16C56, PIC16C58 */
						data = R.picRAM[addr];
					}
					break;
		default:	data = R.picRAM[addr]; break;
	}

	return data;
}
Esempio n. 3
0
static void in_p(void)
{
	R.ALU.w.l = P_IN( (R.opcode.b.h & 7) );
	putdata(R.ALU.w.l);
}
Esempio n. 4
0
void tms32010_device::in_p()
{
	m_ALU.w.l = P_IN( (m_opcode.b.h & 7) );
	putdata(m_ALU.w.l);
}
Esempio n. 5
0
static void in_p(tms32010_state *cpustate)
{
    cpustate->ALU.w.l = P_IN( (cpustate->opcode.b.h & 7) );
    putdata(cpustate, cpustate->ALU.w.l);
}