]> git.sur5r.net Git - cc65/commitdiff
Support for the Mitsubishi 740 CPU for da65. Written and contributed by
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 31 Dec 2011 13:09:55 +0000 (13:09 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 31 Dec 2011 13:09:55 +0000 (13:09 +0000)
Chris Baird, cjb@brushtail.apana.org.au.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5350 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/instr.c
src/common/cpu.c
src/common/cpu.h
src/da65/handler.c
src/da65/handler.h
src/da65/make/gcc.mak
src/da65/make/watcom.mak
src/da65/opcm740.c [new file with mode: 0644]
src/da65/opcm740.h [new file with mode: 0644]
src/da65/opctable.c

index 95bff155a6f14805eab4c3672fd3cad9386b71a4..198a3d39cc2d9d17bd77a78a2fdb18bd9a3c4eff 100644 (file)
@@ -784,10 +784,11 @@ static const InsTable* InsTabs[CPU_COUNT] = {
 #ifdef SUNPLUS
     (const InsTable*) &InsTabSunPlus,
 #else
-    NULL,
+    0,
 #endif
     (const InsTable*) &InsTabSweet16,
     (const InsTable*) &InsTabHuC6280,
+    0,                                  /* Mitsubishi 740 */
 };
 const InsTable* InsTab = (const InsTable*) &InsTab6502;
 
index 9f38f07ceab4cd67eb73b263c73dbe59d2a7eb85..3ac1108a5a48bf817ed0e3b9611d525110eb1ab5 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2003-2009, Ullrich von Bassewitz                                      */
+/* (C) 2003-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -61,6 +61,7 @@ const char* CPUNames[CPU_COUNT] = {
     "sunplus",
     "sweet16",
     "huc6280",
+    "m740",
 };
 
 /* Tables with CPU instruction sets */
@@ -74,6 +75,7 @@ const unsigned CPUIsets[CPU_COUNT] = {
     CPU_ISET_SUNPLUS,
     CPU_ISET_SWEET16,
     CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 | CPU_ISET_HUC6280,
+    CPU_ISET_6502 | CPU_ISET_M740,
 };
 
 
index 16dd0e3096675a6f8c3c9a86602a1b96627ef513..64f2974b66f4a1226651c21d80fe162b42682124 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2003-2009, Ullrich von Bassewitz                                      */
+/* (C) 2003-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -56,6 +56,7 @@ typedef enum {
     CPU_SUNPLUS,               /* Not in the freeware version - sorry */
     CPU_SWEET16,
     CPU_HUC6280,                /* Used in PC engine */
+    CPU_M740,                   /* Mitsubishi 740 series MCUs */
     CPU_COUNT                          /* Number of different CPUs */
 } cpu_t;
 
@@ -70,6 +71,7 @@ enum {
     CPU_ISET_SUNPLUS    = 1 << CPU_SUNPLUS,
     CPU_ISET_SWEET16    = 1 << CPU_SWEET16,
     CPU_ISET_HUC6280    = 1 << CPU_HUC6280,
+    CPU_ISET_M740       = 1 << CPU_M740,
 };
 
 /* CPU used */
index 8d94f35f8eaf2e2c9e5175595c722604af6c80cf..37cc4fff69da2d3a7923cf4b6025a94f2323fed0 100644 (file)
@@ -552,6 +552,86 @@ void OH_AbsoluteXIndirect (const OpcDesc* D attribute ((unused)))
 
 
 
+void OH_DirectImmediate (const OpcDesc* D)
+{
+    /* Get the operand */
+    unsigned Addr = GetCodeByte (PC+1);
+
+    /* Generate a label in pass 1 */
+    GenerateLabel (D->Flags, Addr);
+
+    /* Output the line */
+    OneLine (D, "%s, #$%02X", GetAddrArg (D->Flags, Addr), GetCodeByte (PC+2));
+}
+
+
+
+void OH_ZeroPageBit (const OpcDesc* D)
+{
+    unsigned Bit = GetCodeByte (PC) >> 5;
+    unsigned Addr = GetCodeByte (PC+1);
+
+    /* Generate a label in pass 1 */
+    GenerateLabel (D->Flags, Addr);
+
+    /* Output the line */
+    OneLine (D, "%01X,%s", Bit, GetAddrArg (D->Flags, Addr));
+}
+
+
+
+void OH_AccumulatorBit (const OpcDesc* D)
+{
+    unsigned Bit = GetCodeByte (PC) >> 5;
+
+    /* Output the line */
+    OneLine (D, "%01X,a", Bit);
+}
+
+
+
+void OH_AccumulatorBitBranch (const OpcDesc* D)
+{
+    unsigned Bit = GetCodeByte (PC) >> 5;
+    signed char BranchOffs = GetCodeByte (PC+1);
+
+    /* Calculate the target address for the branch */
+    unsigned BranchAddr = (((int) PC+3) + BranchOffs) & 0xFFFF;
+
+    /* Generate labels in pass 1 */
+    GenerateLabel (flLabel, BranchAddr);
+
+    /* Output the line */
+    OneLine (D, "%01X,a,%s", Bit, GetAddrArg (flLabel, BranchAddr));
+}
+
+
+
+void OH_JmpDirectIndirect (const OpcDesc* D)
+{
+    OH_DirectIndirect (D);
+    if (NewlineAfterJMP) {
+        LineFeed ();
+    }
+    SeparatorLine ();
+}
+
+
+
+void OH_SpecialPage (const OpcDesc* D)
+{
+  /* Get the operand */
+  unsigned Addr = 0xFF00 + GetCodeByte (PC+1);
+
+  /* Generate a label in pass 1 */
+  GenerateLabel (D->Flags, Addr);
+
+  /* OneLine (D, "$FF%02X", (CodeByte (PC+1)); */
+  OneLine (D, "\%s", GetAddrArg (D->Flags, Addr));
+}
+
+
+
 void OH_Rts (const OpcDesc* D)
 {
     OH_Implicit (D);
index e39a08f21fac86cc419feb85aee6506493553c42..affc4cf389728cd01ecfee8afad7864d31791310 100644 (file)
@@ -87,6 +87,14 @@ void OH_DirectIndirectLongY (const OpcDesc*);
 void OH_BlockMove (const OpcDesc*);
 void OH_AbsoluteXIndirect (const OpcDesc*);
 
+/* Mitsubishi 740 */
+void OH_DirectImmediate (const OpcDesc*);
+void OH_ZeroPageBit (const OpcDesc*);
+void OH_AccumulatorBit (const OpcDesc*);
+void OH_AccumulatorBitBranch (const OpcDesc*);
+void OH_JmpDirectIndirect (const OpcDesc* D);
+void OH_SpecialPage (const OpcDesc*);
+                    
 /* Handlers for special instructions */
 void OH_Rts (const OpcDesc*);
 void OH_JmpAbsolute (const OpcDesc*);
index 4346c8260f875a1cb535efda508b3b7f03baa20d..91dd585b89353be53eab0d5a5c105d565d7a15a8 100644 (file)
@@ -38,6 +38,7 @@ OBJS =        asminc.o        \
        opc65c02.o      \
        opc65sc02.o     \
         opchuc6280.o    \
+        opcm740.o       \
        opctable.o      \
        output.o        \
        scanner.o       \
index bab4f85419011889990b59d38b528115c14b2b93..d2f8e400bfadb0665017bd55b26bde05e49e7832 100644 (file)
@@ -77,6 +77,7 @@ OBJS =        asminc.obj      \
         opc65c02.obj    \
         opc65sc02.obj   \
         opchuc6280.obj  \
+        opcm740.obj     \
        opctable.obj    \
        output.obj      \
        scanner.obj     \
diff --git a/src/da65/opcm740.c b/src/da65/opcm740.c
new file mode 100644 (file)
index 0000000..35940f7
--- /dev/null
@@ -0,0 +1,310 @@
+/*****************************************************************************/
+/*                                                                           */
+/*                                 opcm740.c                                 */
+/*                                                                           */
+/*               Mitsubishi 740 series opcode description table              */
+/*                                                                           */
+/* A contribution from Chris Baird                                           */
+/* EMail:         cjb@brushtail.apana.org.au                                 */
+/*                                                                           */
+/* (C) 2003-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
+/*                                                                           */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+
+
+/* da65 */
+#include "handler.h"
+#include "opcm740.h"
+
+
+
+/*****************************************************************************/
+/*                                  Data                                    */
+/*****************************************************************************/
+
+
+
+/* Descriptions for all opcodes */
+const OpcDesc OpcTable_M740[256] = {
+    {   "brk",  1,  flNone,                   OH_Implicit              }, /* $00 */
+    {   "ora",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $01 */
+    {   "jsr",  2,  flLabel,                  OH_JmpDirectIndirect     }, /* $02 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $03 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $04 */
+    {   "ora",  2,  flUseLabel,               OH_Direct                }, /* $05 */
+    {   "asl",  2,  flUseLabel,               OH_Direct                }, /* $06 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $07 */
+    {   "php",  1,  flNone,                   OH_Implicit              }, /* $08 */
+    {   "ora",  2,  flNone,                   OH_Immediate             }, /* $09 */
+    {   "asl",  1,  flNone,                   OH_Accumulator           }, /* $0a */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $0b */
+    {   "",     1,  flIllegal,                OH_Illegal,              }, /* $0c */
+    {   "ora",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $0d */
+    {   "asl",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $0e */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $0f */
+    {   "bpl",  2,  flLabel,                  OH_Relative              }, /* $10 */
+    {   "ora",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $11 */
+    {   "clt",  1,  flNone,                   OH_Implicit              }, /* $12 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $13 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $14 */
+    {   "ora",  2,  flUseLabel,               OH_DirectX               }, /* $15 */
+    {   "asl",  2,  flUseLabel,               OH_DirectX               }, /* $16 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $17 */
+    {   "clc",  1,  flNone,                   OH_Implicit              }, /* $18 */
+    {   "ora",  3,  flUseLabel,               OH_AbsoluteY             }, /* $19 */
+    {   "dec",  1,  flNone,                   OH_Accumulator           }, /* $1a */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $1b */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $1c */
+    {   "ora",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $1d */
+    {   "asl",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $1e */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $1f */
+    {   "jsr",  3,  flLabel,                  OH_Absolute              }, /* $20 */
+    {   "and",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $21 */
+    {   "jsr",  2,  flLabel,                  OH_SpecialPage           }, /* $22 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $23 */
+    {   "bit",  2,  flUseLabel,               OH_Direct                }, /* $24 */
+    {   "and",  2,  flUseLabel,               OH_Direct                }, /* $25 */
+    {   "rol",  2,  flUseLabel,               OH_Direct                }, /* $26 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $27 */
+    {   "plp",  1,  flNone,                   OH_Implicit              }, /* $28 */
+    {   "and",  2,  flNone,                   OH_Immediate             }, /* $29 */
+    {   "rol",  1,  flNone,                   OH_Accumulator           }, /* $2a */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $2b */
+    {   "bit",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $2c */
+    {   "and",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $2d */
+    {   "rol",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $2e */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $2f */
+    {   "bmi",  2,  flLabel,                  OH_Relative              }, /* $30 */
+    {   "and",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $31 */
+    {   "set",  1,  flNone,                   OH_Implicit              }, /* $32 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $33 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $34 */
+    {   "and",  2,  flUseLabel,               OH_DirectX               }, /* $35 */
+    {   "rol",  2,  flUseLabel,               OH_DirectX               }, /* $36 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $37 */
+    {   "sec",  1,  flNone,                   OH_Implicit              }, /* $38 */
+    {   "and",  3,  flUseLabel,               OH_AbsoluteY             }, /* $39 */
+    {   "inc",  1,  flNone,                   OH_Accumulator           }, /* $3a */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $3b */
+    {   "ldm",  3,  flLabel,                  OH_DirectImmediate       }, /* $3c */
+    {   "and",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $3d */
+    {   "rol",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $3e */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $3f */
+    {   "rti",  1,  flNone,                   OH_Rts                   }, /* $40 */
+    {   "eor",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $41 */
+    {   "stp",  1,  flNone,                   OH_Implicit              }, /* $42 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $43 */
+    {   "com",  2,  flUseLabel,               OH_Direct                }, /* $44 */
+    {   "eor",  2,  flUseLabel,               OH_Direct                }, /* $45 */
+    {   "lsr",  2,  flUseLabel,               OH_Direct                }, /* $46 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $47 */
+    {   "pha",  1,  flNone,                   OH_Implicit              }, /* $48 */
+    {   "eor",  2,  flNone,                   OH_Immediate             }, /* $49 */
+    {   "lsr",  1,  flNone,                   OH_Accumulator           }, /* $4a */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $4b */
+    {   "jmp",  3,  flLabel,                  OH_JmpAbsolute           }, /* $4c */
+    {   "eor",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $4d */
+    {   "lsr",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $4e */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $4f */
+    {   "bvc",  2,  flLabel,                  OH_Relative              }, /* $50 */
+    {   "eor",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $51 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $52 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $53 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $54 */
+    {   "eor",  2,  flUseLabel,               OH_DirectX               }, /* $55 */
+    {   "lsr",  2,  flUseLabel,               OH_DirectX               }, /* $56 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $57 */
+    {   "cli",  1,  flNone,                   OH_Implicit              }, /* $58 */
+    {   "eor",  3,  flUseLabel,               OH_AbsoluteY             }, /* $59 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $5a */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $5b */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $5c */
+    {   "eor",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $5d */
+    {   "lsr",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $5e */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $5f */
+    {   "rts",  1,  flNone,                   OH_Rts                   }, /* $60 */
+    {   "adc",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $61 */
+    {   "mul",  2,  flUseLabel,               OH_DirectX               }, /* $62 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $63 */
+    {   "tst",  2,  flUseLabel,               OH_Direct                }, /* $64 */
+    {   "adc",  2,  flUseLabel,               OH_Direct                }, /* $65 */
+    {   "ror",  2,  flUseLabel,               OH_Direct                }, /* $66 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $67 */
+    {   "pla",  1,  flNone,                   OH_Implicit              }, /* $68 */
+    {   "adc",  2,  flNone,                   OH_Immediate             }, /* $69 */
+    {   "ror",  1,  flNone,                   OH_Accumulator           }, /* $6a */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $6b */
+    {   "jmp",  3,  flLabel,                  OH_JmpAbsoluteIndirect   }, /* $6c */
+    {   "adc",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $6d */
+    {   "ror",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $6e */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $6f */
+    {   "bvs",  2,  flLabel,                  OH_Relative              }, /* $70 */
+    {   "adc",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $71 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $72 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $73 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $74 */
+    {   "adc",  2,  flUseLabel,               OH_DirectX               }, /* $75 */
+    {   "ror",  2,  flUseLabel,               OH_DirectX               }, /* $76 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $77 */
+    {   "sei",  1,  flNone,                   OH_Implicit              }, /* $78 */
+    {   "adc",  3,  flUseLabel,               OH_AbsoluteY             }, /* $79 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $7a */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $7b */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $7c */
+    {   "adc",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $7d */
+    {   "ror",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $7e */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $7f */
+    {   "bra",  2,  flLabel,                  OH_Relative              }, /* $80 */
+    {   "sta",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $81 */
+    {   "rrf",  2,  flLabel,                  OH_Direct                }, /* $82 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $83 */
+    {   "sty",  2,  flUseLabel,               OH_Direct                }, /* $84 */
+    {   "sta",  2,  flUseLabel,               OH_Direct                }, /* $85 */
+    {   "stx",  2,  flUseLabel,               OH_Direct                }, /* $86 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $87 */
+    {   "dey",  1,  flNone,                   OH_Implicit              }, /* $88 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $89 */
+    {   "txa",  1,  flNone,                   OH_Implicit              }, /* $8a */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $8b */
+    {   "sty",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $8c */
+    {   "sta",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $8d */
+    {   "stx",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $8e */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $8f */
+    {   "bcc",  2,  flLabel,                  OH_Relative              }, /* $90 */
+    {   "sta",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $91 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $92 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $93 */
+    {   "sty",  2,  flUseLabel,               OH_DirectX               }, /* $94 */
+    {   "sta",  2,  flUseLabel,               OH_DirectX               }, /* $95 */
+    {   "stx",  2,  flUseLabel,               OH_DirectY               }, /* $96 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $97 */
+    {   "tya",  1,  flNone,                   OH_Implicit              }, /* $98 */
+    {   "sta",  3,  flUseLabel,               OH_AbsoluteY             }, /* $99 */
+    {   "txs",  1,  flNone,                   OH_Implicit              }, /* $9a */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $9b */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $9c */
+    {   "sta",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $9d */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $9e */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $9f */
+    {   "ldy",  2,  flNone,                   OH_Immediate             }, /* $a0 */
+    {   "lda",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $a1 */
+    {   "ldx",  2,  flNone,                   OH_Immediate             }, /* $a2 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $a3 */
+    {   "ldy",  2,  flUseLabel,               OH_Direct                }, /* $a4 */
+    {   "lda",  2,  flUseLabel,               OH_Direct                }, /* $a5 */
+    {   "ldx",  2,  flUseLabel,               OH_Direct                }, /* $a6 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $a7 */
+    {   "tay",  1,  flNone,                   OH_Implicit              }, /* $a8 */
+    {   "lda",  2,  flNone,                   OH_Immediate             }, /* $a9 */
+    {   "tax",  1,  flNone,                   OH_Implicit              }, /* $aa */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $ab */
+    {   "ldy",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ac */
+    {   "lda",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ad */
+    {   "ldx",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ae */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $af */
+    {   "bcs",  2,  flLabel,                  OH_Relative              }, /* $b0 */
+    {   "lda",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $b1 */
+    {   "jmp",  2,  flLabel,                  OH_JmpDirectIndirect     }, /* $b2 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $b3 */
+    {   "ldy",  2,  flUseLabel,               OH_DirectX               }, /* $b4 */
+    {   "lda",  2,  flUseLabel,               OH_DirectX               }, /* $b5 */
+    {   "ldx",  2,  flUseLabel,               OH_DirectY               }, /* $b6 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $b7 */
+    {   "clv",  1,  flNone,                   OH_Implicit              }, /* $b8 */
+    {   "lda",  3,  flUseLabel,               OH_AbsoluteY             }, /* $b9 */
+    {   "tsx",  1,  flNone,                   OH_Implicit              }, /* $ba */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $bb */
+    {   "ldy",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $bc */
+    {   "lda",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $bd */
+    {   "ldx",  3,  flUseLabel|flAbsOverride, OH_AbsoluteY             }, /* $be */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $bf */
+    {   "cpy",  2,  flNone,                   OH_Immediate             }, /* $c0 */
+    {   "cmp",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $c1 */
+    {   "wit",  1,  flNone,                   OH_Implicit,             }, /* $c2 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $c3 */
+    {   "cpy",  2,  flUseLabel,               OH_Direct                }, /* $c4 */
+    {   "cmp",  2,  flUseLabel,               OH_Direct                }, /* $c5 */
+    {   "dec",  2,  flUseLabel,               OH_Direct                }, /* $c6 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $c7 */
+    {   "iny",  1,  flNone,                   OH_Implicit              }, /* $c8 */
+    {   "cmp",  2,  flNone,                   OH_Immediate             }, /* $c9 */
+    {   "dex",  1,  flNone,                   OH_Implicit              }, /* $ca */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $cb */
+    {   "cpy",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $cc */
+    {   "cmp",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $cd */
+    {   "dec",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ce */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $cf */
+    {   "bne",  2,  flLabel,                  OH_Relative              }, /* $d0 */
+    {   "cmp",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $d1 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $d2 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $d3 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $d4 */
+    {   "cmp",  2,  flUseLabel,               OH_DirectX               }, /* $d5 */
+    {   "dec",  2,  flUseLabel,               OH_DirectX               }, /* $d6 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $d7 */
+    {   "cld",  1,  flNone,                   OH_Implicit              }, /* $d8 */
+    {   "cmp",  3,  flUseLabel,               OH_AbsoluteY             }, /* $d9 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $da */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $db */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $dc */
+    {   "cmp",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $dd */
+    {   "dec",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $de */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $df */
+    {   "cpx",  2,  flNone,                   OH_Immediate             }, /* $e0 */
+    {   "sbc",  2,  flUseLabel,               OH_DirectXIndirect       }, /* $e1 */
+    {   "div",  2,  flUseLabel,               OH_DirectX               }, /* $e2 */
+    {   "bbs",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $e3 */
+    {   "cpx",  2,  flUseLabel,               OH_Direct                }, /* $e4 */
+    {   "sbc",  2,  flUseLabel,               OH_Direct                }, /* $e5 */
+    {   "inc",  2,  flUseLabel,               OH_Direct                }, /* $e6 */
+    {   "bbs",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $e7 */
+    {   "inx",  1,  flNone,                   OH_Implicit              }, /* $e8 */
+    {   "sbc",  2,  flNone,                   OH_Immediate             }, /* $e9 */
+    {   "nop",  1,  flNone,                   OH_Implicit              }, /* $ea */
+    {   "seb",  1,  flNone,                   OH_AccumulatorBit        }, /* $eb */
+    {   "cpx",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ec */
+    {   "sbc",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ed */
+    {   "inc",  3,  flUseLabel|flAbsOverride, OH_Absolute              }, /* $ee */
+    {   "seb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $ef */
+    {   "beq",  2,  flLabel,                  OH_Relative              }, /* $f0 */
+    {   "sbc",  2,  flUseLabel,               OH_DirectIndirectY       }, /* $f1 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $f2 */
+    {   "bbc",  2,  flUseLabel,               OH_AccumulatorBitBranch  }, /* $f3 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $f4 */
+    {   "sbc",  2,  flUseLabel,               OH_DirectX               }, /* $f5 */
+    {   "inc",  2,  flUseLabel,               OH_DirectX               }, /* $f6 */
+    {   "bbc",  3,  flUseLabel,               OH_ZeroPageBit           }, /* $f7 */
+    {   "sed",  1,  flNone,                   OH_Implicit              }, /* $f8 */
+    {   "sbc",  3,  flUseLabel,               OH_AbsoluteY             }, /* $f9 */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $fa */
+    {   "clb",  1,  flNone,                   OH_AccumulatorBit        }, /* $fb */
+    {   "",     1,  flIllegal,                OH_Illegal               }, /* $fc */
+    {   "sbc",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $fd */
+    {   "inc",  3,  flUseLabel|flAbsOverride, OH_AbsoluteX             }, /* $fe */
+    {   "clb",  2,  flUseLabel,               OH_ZeroPageBit           }, /* $ff */
+};
+
+
+
diff --git a/src/da65/opcm740.h b/src/da65/opcm740.h
new file mode 100644 (file)
index 0000000..20d9ee6
--- /dev/null
@@ -0,0 +1,61 @@
+/*****************************************************************************/
+/*                                                                           */
+/*                                 opcm740.h                                 */
+/*                                                                           */
+/*               Mitsubishi 740 series opcode description table              */
+/*                                                                           */
+/* A contribution from Chris Baird                                           */
+/* EMail:         cjb@brushtail.apana.org.au                                 */
+/*                                                                           */
+/* (C) 2003-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
+/*                                                                           */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+
+
+#ifndef OPCM740_H
+#define OPCM740_H
+
+
+
+#include "opcdesc.h"
+
+
+
+/*****************************************************************************/
+/*                                  Data                                    */
+/*****************************************************************************/
+
+
+
+/* Descriptions for all opcodes */
+extern const OpcDesc OpcTable_M740[256];
+
+
+
+/* End of opcm740.h */
+#endif
+
+
+
index 8b4685a6f52b4ea13b5b9c1912d357a7d7ce6b20..e29b66e7ee7194b4f698350b3e034b4bb882b7b7 100644 (file)
@@ -41,6 +41,7 @@
 #include "opc65c02.h"
 #include "opc65sc02.h"
 #include "opchuc6280.h"
+#include "opcm740.h"
 #include "opctable.h"
 
 
@@ -71,6 +72,7 @@ void SetOpcTable (cpu_t CPU)
         case CPU_65SC02:  OpcTable = OpcTable_65SC02;   break;
         case CPU_65C02:   OpcTable = OpcTable_65C02;    break;
         case CPU_HUC6280: OpcTable = OpcTable_HuC6280;  break;
+        case CPU_M740:    OpcTable = OpcTable_M740;     break;
         default:          Error ("Unsupported CPU");
     }
 }