summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/v60/op5.hxx
blob: a70a1809ce0025047d5e27ef2457101f44f8757b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// license:BSD-3-Clause
// copyright-holders:Farfetch'd, R. Belmont
/*
 *  HALT: must add log
 */

uint32_t v60_device::opBRK()
{
/*
    uint32_t oldPSW = v60_update_psw_for_exception(0, 0);

    SP -=4;
    m_program->write_dword_unaligned(SP, EXCEPTION_CODE_AND_SIZE(0x0d00, 4));
    SP -=4;
    m_program->write_dword_unaligned(SP, oldPSW);
    SP -=4;
    m_program->write_dword_unaligned(SP, PC + 1);
    PC = GETINTVECT(13);
*/
	logerror("Skipping BRK opcode! PC=%x", PC);

	return 1;
}

uint32_t v60_device::opBRKV()
{
	uint32_t oldPSW = v60_update_psw_for_exception(0, 0);

	SP -=4;
	m_program->write_dword_unaligned(SP, PC);
	SP -=4;
	m_program->write_dword_unaligned(SP, EXCEPTION_CODE_AND_SIZE(0x1501, 4));
	SP -=4;
	m_program->write_dword_unaligned(SP, oldPSW);
	SP -=4;
	m_program->write_dword_unaligned(SP, PC + 1);
	PC = GETINTVECT(21);

	return 0;
}

uint32_t v60_device::opCLRTLBA()
{
	// @@@ TLB not yet supported
	logerror("Skipping CLRTLBA opcode! PC=%x\n", PC);
	return 1;
}

uint32_t v60_device::opDISPOSE()
{
	SP = FP;
	FP = m_program->read_dword_unaligned(SP);
	SP +=4;

	return 1;
}

uint32_t v60_device::opHALT()
{
	// @@@ It should wait for an interrupt to occur
	//logerror("HALT found: skipping");
	return 1;
}

uint32_t v60_device::opNOP() /* TRUSTED */
{
	return 1;
}

uint32_t v60_device::opRSR()
{
	PC = m_program->read_dword_unaligned(SP);
	SP +=4;

	return 0;
}

uint32_t v60_device::opTRAPFL()
{
	if ((TKCW & 0x1F0) & ((v60ReadPSW() & 0x1F00) >> 4))
	{
		// @@@ FPU exception
		fatalerror("Hit TRAPFL! PC=%x\n", PC);
	}

	return 1;
}