Exemplo n.º 1
0
static UINT32 opBLT8(v60_state *cpustate) /* TRUSTED */
{
    NORMALIZEFLAGS(cpustate);

    if ((cpustate->_S ^ cpustate->_OV))
    {
        cpustate->PC += (INT8)OpRead8(cpustate, cpustate->PC + 1);
        return 0;
    }

    return 2;
}
Exemplo n.º 2
0
static UINT32 opBLE16(v60_state *cpustate) /* TRUSTED */
{
    NORMALIZEFLAGS(cpustate);

    if (((cpustate->_S ^ cpustate->_OV) | cpustate->_Z))
    {
        cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 1);
        return 0;
    }

    return 3;
}
Exemplo n.º 3
0
UINT32 opBLE8(void) /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (((_S ^ _OV) | _Z))
	{
		PC += (INT8)OpRead8(PC + 1);
		return 0;
	}

	return 2;
}
Exemplo n.º 4
0
UINT32 opBLE16(void) /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (((_S ^ _OV) | _Z))
	{
		PC += (INT16)OpRead16(PC + 1);
		return 0;
	}

	return 3;
}
Exemplo n.º 5
0
UINT32 v60_device::opBLE16() /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (((_S ^ _OV) | _Z))
	{
		PC += (INT16)OpRead16(PC + 1);
		return 0;
	}

	return 3;
}
Exemplo n.º 6
0
static UINT32 opBGT8(v60_state *cpustate) /* TRUSTED */
{
	NORMALIZEFLAGS(cpustate);

	if (!((cpustate->_S ^ cpustate->_OV) | cpustate->_Z))
	{
		cpustate->PC += (INT8)OpRead8(cpustate->program, cpustate->PC + 1);
		return 0;
	}

	return 2;
}
Exemplo n.º 7
0
UINT32 v60_device::opBLE8() /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (((_S ^ _OV) | _Z))
	{
		PC += (INT8)OpRead8(PC + 1);
		return 0;
	}

	return 2;
}
Exemplo n.º 8
0
static UINT32 opBGE16(v60_state *cpustate) /* TRUSTED */
{
	NORMALIZEFLAGS(cpustate);

	if (!(cpustate->_S ^ cpustate->_OV))
	{
		cpustate->PC += (INT16)OpRead16(cpustate->program, cpustate->PC + 1);
		return 0;
	}

	return 3;
}
Exemplo n.º 9
0
static UINT32 opBGE16(void) /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (!(_S ^ _OV))
	{
		PC += (INT16)OpRead16(PC + 1);
		return 0;
	}

	return 3;
}
Exemplo n.º 10
0
static UINT32 opBGE8(void) /* TRUSTED */
{
	NORMALIZEFLAGS();

	if (!(_S ^ _OV))
	{
		PC += (INT8)OpRead8(PC + 1);
		return 0;
	}

	return 2;
}
Exemplo n.º 11
0
static UINT32 opDBLT(v60_state *cpustate, int reg) /* TRUSTED */
{
	cpustate->reg[reg]--;

	NORMALIZEFLAGS(cpustate);
	if ((cpustate->reg[reg] != 0) && (cpustate->_S ^ cpustate->_OV))
	{
		cpustate->PC += (INT16)OpRead16(cpustate, cpustate->PC + 2);
		return 0;
	}

	return 4;
}
Exemplo n.º 12
0
static UINT32 opTRAP(v60_state *cpustate)
{
	UINT32 oldPSW;

	cpustate->modadd = cpustate->PC + 1;
	cpustate->moddim = 0;

	// Read the operand
	cpustate->amlength1 = ReadAM(cpustate);

	// Normalize the flags
	NORMALIZEFLAGS(cpustate);

	switch ((cpustate->amout >> 4) & 0xF)
	{
	case 0:
		if (!cpustate->_OV) return cpustate->amlength1 + 1;
		else break;
	case 1:
		if (cpustate->_OV) return cpustate->amlength1 + 1;
		else break;
	case 2:
		if (!cpustate->_CY) return cpustate->amlength1 + 1;
		else break;
	case 3:
		if (cpustate->_CY) return cpustate->amlength1 + 1;
		else break;
	case 4:
		if (!cpustate->_Z) return cpustate->amlength1 + 1;
		else break;
	case 5:
		if (cpustate->_Z) return cpustate->amlength1 + 1;
		else break;
	case 6:
		if (!(cpustate->_CY | cpustate->_Z)) return cpustate->amlength1 + 1;
		else break;
	case 7:
		if ((cpustate->_CY | cpustate->_Z)) return cpustate->amlength1 + 1;
		else break;
	case 8:
		if (!cpustate->_S) return cpustate->amlength1 + 1;
		else break;
	case 9:
		if (cpustate->_S) return cpustate->amlength1 + 1;
		else break;
	case 10:
		break;
	case 11:
		return cpustate->amlength1 + 1;
	case 12:
		if (!(cpustate->_S^cpustate->_OV)) return cpustate->amlength1 + 1;
		else break;
	case 13:
		if ((cpustate->_S^cpustate->_OV)) return cpustate->amlength1 + 1;
		else break;
	case 14:
		if (!((cpustate->_S^cpustate->_OV)|cpustate->_Z)) return cpustate->amlength1 + 1;
		else break;
	case 15:
		if (((cpustate->_S^cpustate->_OV)|cpustate->_Z)) return cpustate->amlength1 + 1;
		else break;
	}

	oldPSW = v60_update_psw_for_exception(cpustate, 0, 0);

	// Issue the software trap with interrupts
	cpustate->SP -= 4;
	cpustate->program->write_dword_unaligned(cpustate->SP, EXCEPTION_CODE_AND_SIZE(0x3000 + 0x100 * (cpustate->amout & 0xF), 4));

	cpustate->SP -= 4;
	cpustate->program->write_dword_unaligned(cpustate->SP, oldPSW);

	cpustate->SP -= 4;
	cpustate->program->write_dword_unaligned(cpustate->SP, cpustate->PC + cpustate->amlength1 + 1);

	cpustate->PC = GETINTVECT(cpustate, 48 + (cpustate->amout & 0xF));

	return 0;
}
Exemplo n.º 13
0
UINT32 opTRAP(void)
{
	UINT32 oldPSW;

	modAdd=PC + 1;
	modDim=0;

	/* Read the operand */
	amLength1=ReadAM();

	/* Normalize the flags */
	NORMALIZEFLAGS();

	switch ((amOut >> 4) & 0xF)
	{
	case 0:
		if (!_OV) return amLength1+1;
		else break;
	case 1:
		if (_OV) return amLength1+1;
		else break;
	case 2:
		if (!_CY) return amLength1+1;
		else break;
	case 3:
		if (_CY) return amLength1+1;
		else break;
	case 4:
		if (!_Z) return amLength1+1;
		else break;
	case 5:
		if (_Z) return amLength1+1;
		else break;
	case 6:
		if (!(_CY | _Z)) return amLength1+1;
		else break;
	case 7:
		if ((_CY | _Z)) return amLength1+1;
		else break;
	case 8:
		if (!_S) return amLength1+1;
		else break;
	case 9:
		if (_S) return amLength1+1;
		else break;
	case 10:
		break;
	case 11:
		return amLength1+1;
	case 12:
		if (!(_S^_OV)) return amLength1+1;
		else break;
	case 13:
		if ((_S^_OV)) return amLength1+1;
		else break;
	case 14:
		if (!((_S^_OV)|_Z)) return amLength1+1;
		else break;
	case 15:
		if (((_S^_OV)|_Z)) return amLength1+1;
		else break;
	}

	oldPSW = v60_update_psw_for_exception(0, 0);

	/* Issue the software trap with interrupts */
	SP -= 4;
	MemWrite32(SP, EXCEPTION_CODE_AND_SIZE(0x3000 + 0x100 * (amOut&0xF), 4));

	SP -= 4;
	MemWrite32(SP, oldPSW);

	SP -= 4;
	MemWrite32(SP, PC + amLength1 + 1);

	PC = GETINTVECT(48 + (amOut&0xF));
	ChangePC(PC);

	return 0;
}