1 // license:BSD-3-Clause
2 // copyright-holders:Farfetch'd, R. Belmont
3 // NOTE for bit string / field addressing
4 // ************************************
5 // m_moddim must be passed as 10 for bit string instructions,
6 // and as 11 for bit field instructions
7 
8 
9 
10 
11 // Addressing mode functions and tables
12 #include "am1.hxx" // ReadAM
13 #include "am2.hxx" // ReadAMAddress
14 #include "am3.hxx" // WriteAM
15 
16 /*
17   Input:
18   m_modadd
19     m_moddim
20 
21   Output:
22     m_amout
23     amLength
24 */
25 
ReadAM()26 uint32_t v60_device::ReadAM()
27 {
28 	m_modm = m_modm?1:0;
29 	m_modval = OpRead8(m_modadd);
30 	return (this->*s_AMTable1[m_modm][m_modval >> 5])();
31 }
32 
BitReadAM()33 uint32_t v60_device::BitReadAM()
34 {
35 	m_modm = m_modm?1:0;
36 	m_modval = OpRead8(m_modadd);
37 	return (this->*s_BAMTable1[m_modm][m_modval >> 5])();
38 }
39 
40 
41 
42 /*
43   Input:
44   m_modadd
45     m_moddim
46 
47   Output:
48     m_amout
49     m_amflag
50     amLength
51 */
52 
ReadAMAddress()53 uint32_t v60_device::ReadAMAddress()
54 {
55 	m_modm = m_modm?1:0;
56 	m_modval = OpRead8(m_modadd);
57 	return (this->*s_AMTable2[m_modm][m_modval >> 5])();
58 }
59 
BitReadAMAddress()60 uint32_t v60_device::BitReadAMAddress()
61 {
62 	m_modm = m_modm?1:0;
63 	m_modval = OpRead8(m_modadd);
64 	return (this->*s_BAMTable2[m_modm][m_modval >> 5])();
65 }
66 
67 /*
68   Input:
69   m_modadd
70     m_moddim
71     m_modwritevalb / H/W
72 
73   Output:
74     m_amout
75     amLength
76 */
77 
WriteAM()78 uint32_t v60_device::WriteAM()
79 {
80 	m_modm = m_modm?1:0;
81 	m_modval = OpRead8(m_modadd);
82 	return (this->*s_AMTable3[m_modm][m_modval >> 5])();
83 }
84