Previous 199869 Revisions Next

r33649 Wednesday 3rd December, 2014 at 14:51:54 UTC by David Haywood
misc arc (nw)
[src/emu/cpu/arc]arc.c arc.h arcdasm.c
[src/emu/cpu/arcompact]arcompact.c arcompact.h arcompactdasm.c

trunk/src/emu/cpu/arc/arc.c
r242160r242161
4040
4141/*****************************************************************************/
4242
43UINT16 arc_device::READ32(UINT32 address)
43UINT32 arc_device::READ32(UINT32 address)
4444{
4545   return m_program->read_dword(address << 2);
4646}
trunk/src/emu/cpu/arc/arc.h
r242160r242161
6262   UINT32 m_debugger_temp;
6363
6464   void unimplemented_opcode(UINT16 op);
65   inline UINT16 READ32(UINT32 address);
65   inline UINT32 READ32(UINT32 address);
6666   inline void WRITE32(UINT32 address, UINT32 data);
6767};
6868
trunk/src/emu/cpu/arc/arcdasm.c
r242160r242161
175175   /* 0x3f */ "sImm NF",
176176};
177177
178#define ARC_CONDITION ((op & 0x0000001f) >> 0 )
178#define ARC_CONDITION ((op & 0x0000001f) >> 0 ) // aka Q
179179
180180// used in jumps
181181#define ARC_BRANCH_DELAY     ((op & 0x00000060) >> 5 ) // aka N
182182#define ARC_BRANCH_ADDR      ((op & 0x07ffff80) >> 7 ) // aka L
183183
184#define ARC_OPERATION ((op & 0xf8000000) >> 27) // aka Q
184#define ARC_OPERATION ((op & 0xf8000000) >> 27)
185185
186186#define ARC_REGOP_DEST      ((op & 0x07e00000) >> 21 ) // aka A
187187#define ARC_REGOP_OP1       ((op & 0x001f8000) >> 15 ) // aka B
trunk/src/emu/cpu/arcompact/arcompact.c
r242160r242161
2626
2727arcompact_device::arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2828   : cpu_device(mconfig, ARCA5, "ARCtangent-A5", tag, owner, clock, "arca5", __FILE__)
29   , m_program_config("program", ENDIANNESS_BIG, 32, 24, 0) // some docs describe these as 'middle endian'?!
29   , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) // some docs describe these as 'middle endian'?!
3030{
3131}
3232
r242160r242161
4949
5050/*****************************************************************************/
5151
52UINT16 arcompact_device::READ32(UINT32 address)
52UINT32 arcompact_device::READ32(UINT32 address)
5353{
5454   return m_program->read_dword(address << 2);
5555}
r242160r242161
5959   m_program->write_dword(address << 2, data);
6060}
6161
62UINT16 arcompact_device::READ16(UINT32 address)
63{
64   return m_program->read_word(address << 1);
65}
66
67void arcompact_device::WRITE16(UINT32 address, UINT16 data)
68{
69   m_program->write_word(address << 1, data);
70}
71
72
6273/*****************************************************************************/
6374
6475void arcompact_device::device_start()
r242160r242161
8091   switch (entry.index())
8192   {
8293      case 0:
83         m_debugger_temp = m_pc << 2;
94         m_debugger_temp = m_pc << 1;
8495         break;
8596
8697      case STATE_GENPC:
87         m_debugger_temp = m_pc << 2;
98         m_debugger_temp = m_pc << 1;
8899         break;
89100   }
90101}
r242160r242161
94105   switch (entry.index())
95106   {
96107      case 0:
97         m_pc = (m_debugger_temp & 0xfffffffc) >> 2;
108         m_pc = (m_debugger_temp & 0xfffffffe) >> 1;
98109         break;
99110   }
100111}
r242160r242161
123134
124135      //UINT32 op = READ32(m_pc);
125136
137
126138      m_pc++;
127139
128140      m_icount--;
trunk/src/emu/cpu/arcompact/arcompact.h
r242160r242161
5050   UINT32 m_debugger_temp;
5151
5252   void unimplemented_opcode(UINT16 op);
53   inline UINT16 READ32(UINT32 address);
53   inline UINT32 READ32(UINT32 address);
5454   inline void WRITE32(UINT32 address, UINT32 data);
55   inline UINT16 READ16(UINT32 address);
56   inline void WRITE16(UINT32 address, UINT16 data);
57
58
5559};
5660
5761
trunk/src/emu/cpu/arcompact/arcompactdasm.c
r242160r242161
2525/*****************************************************************************/
2626
2727
28static const char *basic[0x20] =
29{
30   /* opcode below are 32-bit mode */
31   /* 00 */ "Bcc",
32   /* 01 */ "BLcc/BRcc",
33   /* 02 */ "LD r+o",
34   /* 03 */ "ST r+o",
35   /* 04 */ "op a,b,c (basecase)", // basecase ops
36   /* 05 */ "op a,b,c (05 ARC ext)", // ARC processor specific extensions
37   /* 06 */ "op a,b,c (06 ARC ext)",
38   /* 07 */ "op a,b,c (07 User ext)", // User speciifc extensions
39   /* 08 */ "op a,b,c (08 User ext)",
40   /* 09 */ "op a,b,c (09 Market ext)", // Market specific extensions
41   /* 0a */ "op a,b,c (0a Market ext)",
42   /* 0b */ "op a,b,c (0b Market ext)",
43   /* opcodes below are 16-bit mode */
44   /* 0c */ "Load/Add reg-reg",
45   /* 0d */ "Add/Sub/Shft imm",
46   /* 0e */ "Mov/Cmp/Add",
47   /* 0f */ "op_S b,b,c", // single ops
48   /* 10 */ "LD_S",
49   /* 11 */ "LDB_S",
50   /* 12 */ "LDW_S",
51   /* 13 */ "LSW_S.X",
52   /* 14 */ "ST_S",
53   /* 15 */ "STB_S",
54   /* 16 */ "STW_S",
55   /* 17 */ "Shift/Sub/Bit",
56   /* 18 */ "Stack Instr",
57   /* 19 */ "GP Instr",
58   /* 1a */ "PCL Instr",
59   /* 1b */ "MOV_S",
60   /* 1c */ "ADD_S/CMP_S",
61   /* 1d */ "BRcc_S",
62   /* 1e */ "Bcc_S",
63   /* 1f */ "BL_S"
64};
2865
66// condition codes (basic ones are the same as arc
67static const char *conditions[0x20] =
68{
69   /* 00 */ "AL", // (aka RA         - Always)
70   /* 01 */ "EQ", // (aka Z          - Zero
71   /* 02 */ "NE", // (aka NZ         - Non-Zero)
72   /* 03 */ "PL", // (aka P          - Positive)
73   /* 04 */ "MI", // (aka N          - Negative)
74   /* 05 */ "CS", // (aka C,  LO     - Carry set / Lower than) (unsigned)
75   /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned)
76   /* 07 */ "VS", // (aka V          - Overflow set)
77   /* 08 */ "VC", // (aka NV         - Overflow clear)
78   /* 09 */ "GT", // (               - Greater than) (signed)
79   /* 0a */ "GE", // (               - Greater than or Equal) (signed)
80   /* 0b */ "LT", // (               - Less than) (signed)
81   /* 0c */ "LE", // (               - Less than or Equal) (signed)
82   /* 0d */ "HI", // (               - Higher than) (unsigned)
83   /* 0e */ "LS", // (               - Lower or Same) (unsigned)
84   /* 0f */ "PNZ",// (               - Positive non-0 value)
85   /* 10 */ "0x10 Reserved", // possible CPU implementation specifics
86   /* 11 */ "0x11 Reserved",
87   /* 12 */ "0x12 Reserved",
88   /* 13 */ "0x13 Reserved",
89   /* 14 */ "0x14 Reserved",
90   /* 15 */ "0x15 Reserved",
91   /* 16 */ "0x16 Reserved",
92   /* 17 */ "0x17 Reserved",
93   /* 18 */ "0x18 Reserved",
94   /* 19 */ "0x19 Reserved",
95   /* 1a */ "0x1a Reserved",
96   /* 1b */ "0x1b Reserved",
97   /* 1c */ "0x1c Reserved",
98   /* 1d */ "0x1d Reserved",
99   /* 1e */ "0x1e Reserved",
100   /* 1f */ "0x1f Reserved"
101};
102
103#define ARCOMPACT_OPERATION ((op & 0xf800) >> 11)
104
29105CPU_DISASSEMBLE(arcompact)
30106{
31   UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24);
32   op = BIG_ENDIANIZE_INT32(op);
107   int size = 2;
33108
109   UINT32 op = oprom[0] | (oprom[1] << 8);
34110   output = buffer;
35111
36   print("<undefined>");
112   UINT8 instruction = ARCOMPACT_OPERATION;
37113
38   return 4 | DASMFLAG_SUPPORTED;
114   if (instruction < 0x0c)
115   {
116      size = 4;
117      op <<= 16;
118      op |= oprom[2] | (oprom[3] << 8);
119
120      switch (instruction)
121      {
122         case 0x00:
123            if (op & 0x00010000)
124            { // Branch Unconditionally Far
125              // 00000 ssssssssss 1  SSSSSSSSSS N 0 TTTT
126               UINT32 address =   (op & 0x07fe0000) >> 17;
127               address |=        ((op & 0x0000ffc0) >> 6) << 10;
128               address |=        ((op & 0x0000000f) >> 0) << 20;
129
130               print("B %08x (%08x)",  address<<1, op & ~0xffffffcf );
131            }
132            else
133            { // Branch Conditionally
134              // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
135               UINT32 address =   (op & 0x07fe0000) >> 17;
136               address |=        ((op & 0x0000ffc0) >> 6) << 10;
137
138               UINT8 condition = op & 0x0000001f;
139
140               print("B(%s) %08x (%08x)", conditions[condition], address<<1, op & ~0xffffffdf );
141
142            }
143
144            break;
145
146         default:
147            print("%s (%08x)", basic[instruction], op & ~0xf8000000 );
148            break;
149
150      }
151
152     
153   }
154   else
155   {
156      size = 2;
157      print("%s (%04x)", basic[instruction], op & ~0xf800 );
158   }
159
160
161   return size | DASMFLAG_SUPPORTED;
39162}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team