1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

add c64dtv support

This commit is contained in:
Zsolt Branyiczky 2020-11-10 10:32:29 +01:00 committed by Oliver Schmidt
parent 77da8d5490
commit b33b053307
14 changed files with 486 additions and 5 deletions

View File

@ -9,6 +9,7 @@ CPU_ISET_SWEET16 = $0040
CPU_ISET_HUC6280 = $0080
;CPU_ISET_M740 = $0100 not actually implemented
CPU_ISET_4510 = $0200
CPU_ISET_6502DTV = $0400
; CPU capabilities
CPU_NONE = CPU_ISET_NONE
@ -20,3 +21,4 @@ CPU_65816 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65816
CPU_SWEET16 = CPU_ISET_SWEET16
CPU_HUC6280 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_HUC6280
CPU_4510 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_4510
CPU_6502DTV = CPU_ISET_6502|CPU_ISET_6502X|CPU_ISET_6502DTV

View File

@ -505,4 +505,12 @@ OPC_ISC_aby = $FB
OPC_NOP_abx = $FC
OPC_ISC_abx = $FF
.if (.cpu .bitand ::CPU_ISET_6502DTV)
OPC_BRA = $12
OPC_SAC_imm = $32
OPC_SIR_imm = $42
.endif
.endif

View File

@ -151,7 +151,7 @@ Here is a description of all the command line options:
Set the default for the CPU type. The option takes a parameter, which
may be one of
6502, 6502X, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510
6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, sweet16, HuC6280, 4510
<label id="option-create-dep">

View File

@ -303,6 +303,97 @@ static const struct {
}
};
/* Instruction table for the 6502 with illegal instructions (X) and DTV
** extra opcodes (DTV). Some illegal instructions (X, -DTV?) might be not
** supported by DTV. They should be tested on the DTV hardware.
*/
static const struct {
unsigned Count;
InsDesc Ins[78];
} InsTab6502DTV = {
sizeof (InsTab6502DTV.Ins) / sizeof (InsTab6502DTV.Ins[0]),
{
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
{ "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */
{ "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X -DTV? */
{ "AND", 0x080A26C, 0x20, 0, PutAll },
{ "ANE", 0x0800000, 0x8B, 0, PutAll }, /* X */
{ "ARR", 0x0800000, 0x6B, 0, PutAll }, /* X */
{ "ASL", 0x000006e, 0x02, 1, PutAll },
{ "AXS", 0x0800000, 0xCB, 0, PutAll }, /* X, -DTV? */
{ "BCC", 0x0020000, 0x90, 0, PutPCRel8 },
{ "BCS", 0x0020000, 0xb0, 0, PutPCRel8 },
{ "BEQ", 0x0020000, 0xf0, 0, PutPCRel8 },
{ "BIT", 0x000000C, 0x00, 2, PutAll },
{ "BMI", 0x0020000, 0x30, 0, PutPCRel8 },
{ "BNE", 0x0020000, 0xd0, 0, PutPCRel8 },
{ "BPL", 0x0020000, 0x10, 0, PutPCRel8 },
{ "BRA", 0x0020000, 0x12, 0, PutPCRel8 }, /* DTV */
{ "BRK", 0x0000001, 0x00, 0, PutAll },
{ "BVC", 0x0020000, 0x50, 0, PutPCRel8 },
{ "BVS", 0x0020000, 0x70, 0, PutPCRel8 },
{ "CLC", 0x0000001, 0x18, 0, PutAll },
{ "CLD", 0x0000001, 0xd8, 0, PutAll },
{ "CLI", 0x0000001, 0x58, 0, PutAll },
{ "CLV", 0x0000001, 0xb8, 0, PutAll },
{ "CMP", 0x080A26C, 0xc0, 0, PutAll },
{ "CPX", 0x080000C, 0xe0, 1, PutAll },
{ "CPY", 0x080000C, 0xc0, 1, PutAll },
{ "DCP", 0x000A26C, 0xC3, 0, PutAll }, /* X */
{ "DEC", 0x000006C, 0x00, 3, PutAll },
{ "DEX", 0x0000001, 0xca, 0, PutAll },
{ "DEY", 0x0000001, 0x88, 0, PutAll },
{ "EOR", 0x080A26C, 0x40, 0, PutAll },
{ "INC", 0x000006c, 0x00, 4, PutAll },
{ "INX", 0x0000001, 0xe8, 0, PutAll },
{ "INY", 0x0000001, 0xc8, 0, PutAll },
{ "ISC", 0x000A26C, 0xE3, 0, PutAll }, /* X */
{ "JAM", 0x0000001, 0x02, 0, PutAll }, /* X, -DTV? */
{ "JMP", 0x0000808, 0x4c, 6, PutJMP },
{ "JSR", 0x0000008, 0x20, 7, PutAll },
{ "LAS", 0x0000200, 0xBB, 0, PutAll }, /* X, -DTV? */
{ "LAX", 0x080A30C, 0xA3, 11, PutAll }, /* X */
{ "LDA", 0x080A26C, 0xa0, 0, PutAll },
{ "LDX", 0x080030C, 0xa2, 1, PutAll },
{ "LDY", 0x080006C, 0xa0, 1, PutAll },
{ "LSR", 0x000006F, 0x42, 1, PutAll },
{ "NOP", 0x080006D, 0x00, 10, PutAll }, /* X */
{ "ORA", 0x080A26C, 0x00, 0, PutAll },
{ "PHA", 0x0000001, 0x48, 0, PutAll },
{ "PHP", 0x0000001, 0x08, 0, PutAll },
{ "PLA", 0x0000001, 0x68, 0, PutAll },
{ "PLP", 0x0000001, 0x28, 0, PutAll },
{ "RLA", 0x000A26C, 0x23, 0, PutAll }, /* X */
{ "ROL", 0x000006F, 0x22, 1, PutAll },
{ "ROR", 0x000006F, 0x62, 1, PutAll },
{ "RRA", 0x000A26C, 0x63, 0, PutAll }, /* X */
{ "RTI", 0x0000001, 0x40, 0, PutAll },
{ "RTS", 0x0000001, 0x60, 0, PutAll },
{ "SAC", 0x0800000, 0x32, 0, PutAll }, /* DTV */
{ "SAX", 0x000810C, 0x83, 1, PutAll }, /* X */
{ "SBC", 0x080A26C, 0xe0, 0, PutAll },
{ "SEC", 0x0000001, 0x38, 0, PutAll },
{ "SED", 0x0000001, 0xf8, 0, PutAll },
{ "SEI", 0x0000001, 0x78, 0, PutAll },
{ "SHA", 0x0002200, 0x93, 1, PutAll }, /* X, -DTV? */
{ "SHX", 0x0000200, 0x9e, 1, PutAll }, /* X, -DTV? */
{ "SHY", 0x0000040, 0x9c, 1, PutAll }, /* X, -DTV? */
{ "SIR", 0x0800000, 0x32, 0, PutAll }, /* DTV */
{ "SLO", 0x000A26C, 0x03, 0, PutAll }, /* X */
{ "SRE", 0x000A26C, 0x43, 0, PutAll }, /* X */
{ "STA", 0x000A26C, 0x80, 0, PutAll },
{ "STX", 0x000010c, 0x82, 1, PutAll },
{ "STY", 0x000002c, 0x80, 1, PutAll },
{ "TAS", 0x0000200, 0x9b, 0, PutAll }, /* X */
{ "TAX", 0x0000001, 0xaa, 0, PutAll },
{ "TAY", 0x0000001, 0xa8, 0, PutAll },
{ "TSX", 0x0000001, 0xba, 0, PutAll },
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
{ "TYA", 0x0000001, 0x98, 0, PutAll }
}
};
/* Instruction table for the 65SC02 */
static const struct {
unsigned Count;
@ -930,6 +1021,7 @@ static const InsTable* InsTabs[CPU_COUNT] = {
(const InsTable*) &InsTabNone,
(const InsTable*) &InsTab6502,
(const InsTable*) &InsTab6502X,
(const InsTable*) &InsTab6502DTV,
(const InsTable*) &InsTab65SC02,
(const InsTable*) &InsTab65C02,
(const InsTable*) &InsTab65816,

View File

@ -186,6 +186,7 @@ void g_preamble (void)
switch (CPU) {
case CPU_6502: AddTextLine ("\t.setcpu\t\t\"6502\""); break;
case CPU_6502X: AddTextLine ("\t.setcpu\t\t\"6502X\""); break;
case CPU_6502DTV: AddTextLine ("\t.setcpu\t\t\"6502DTV\""); break;
case CPU_65SC02: AddTextLine ("\t.setcpu\t\t\"65SC02\""); break;
case CPU_65C02: AddTextLine ("\t.setcpu\t\t\"65C02\""); break;
case CPU_65816: AddTextLine ("\t.setcpu\t\t\"65816\""); break;
@ -2474,7 +2475,7 @@ void g_branch (unsigned Label)
** the label cannot be farther away from the branch than -128/+127 bytes.
*/
{
if ((CPUIsets[CPU] & CPU_ISET_65SC02) != 0) {
if ((CPUIsets[CPU] & (CPU_ISET_65SC02 | CPU_ISET_6502DTV)) != 0) {
AddCodeLine ("bra %s", LocalLabelName (Label));
} else {
g_jump (Label);

View File

@ -173,7 +173,7 @@ unsigned OptBranchDist (CodeSeg* S)
}
} else if ((CPUIsets[CPU] & CPU_ISET_65SC02) != 0 &&
} else if ((CPUIsets[CPU] & (CPU_ISET_65SC02 |CPU_ISET_6502DTV)) != 0 &&
(E->Info & OF_UBRA) != 0 &&
E->JumpTo != 0 &&
IsShortDist (GetBranchDist (S, I, E->JumpTo->Owner))) {

View File

@ -463,7 +463,8 @@ static void OptCPU (const char* Opt, const char* Arg)
/* Find the CPU from the given name */
CPU = FindCPU (Arg);
if (CPU != CPU_6502 && CPU != CPU_6502X && CPU != CPU_65SC02 &&
CPU != CPU_65C02 && CPU != CPU_65816 && CPU != CPU_HUC6280) {
CPU != CPU_65C02 && CPU != CPU_65816 && CPU != CPU_HUC6280 &&
CPU != CPU_6502DTV) {
AbEnd ("Invalid argument for %s: '%s'", Opt, Arg);
}
}

View File

@ -734,7 +734,7 @@ opc_t MakeShortBranch (opc_t OPC)
case OP65_BVS:
case OP65_JVS: return OP65_BVS;
case OP65_BRA:
case OP65_JMP: return (CPUIsets[CPU] & CPU_ISET_65SC02)? OP65_BRA : OP65_JMP;
case OP65_JMP: return (CPUIsets[CPU] & (CPU_ISET_65SC02 | CPU_ISET_6502DTV)) ? OP65_BRA : OP65_JMP;
default:
Internal ("MakeShortBranch: Invalid opcode: %d", OPC);
return 0;

View File

@ -55,6 +55,7 @@ const char* CPUNames[CPU_COUNT] = {
"none",
"6502",
"6502X",
"6502DTV",
"65SC02",
"65C02",
"65816",
@ -69,6 +70,7 @@ const unsigned CPUIsets[CPU_COUNT] = {
CPU_ISET_NONE,
CPU_ISET_6502,
CPU_ISET_6502 | CPU_ISET_6502X,
CPU_ISET_6502 | CPU_ISET_6502X | CPU_ISET_6502DTV,
CPU_ISET_6502 | CPU_ISET_65SC02,
CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02,
CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 | CPU_ISET_65816,

View File

@ -50,6 +50,7 @@ typedef enum {
CPU_NONE, /* No CPU - for assembler */
CPU_6502,
CPU_6502X, /* "Extended", that is: with illegal opcodes */
CPU_6502DTV, /* CPU_6502X + C64DTV extra opcodes */
CPU_65SC02,
CPU_65C02,
CPU_65816,
@ -65,6 +66,7 @@ enum {
CPU_ISET_NONE = 1 << CPU_NONE,
CPU_ISET_6502 = 1 << CPU_6502,
CPU_ISET_6502X = 1 << CPU_6502X,
CPU_ISET_6502DTV = 1 << CPU_6502DTV,
CPU_ISET_65SC02 = 1 << CPU_65SC02,
CPU_ISET_65C02 = 1 << CPU_65C02,
CPU_ISET_65816 = 1 << CPU_65816,

View File

@ -90,6 +90,7 @@
<ClCompile Include="da65\opc4510.c" />
<ClCompile Include="da65\opc6502.c" />
<ClCompile Include="da65\opc6502x.c" />
<ClCompile Include="da65\opc6502dtv.c" />
<ClCompile Include="da65\opc65816.c" />
<ClCompile Include="da65\opc65c02.c" />
<ClCompile Include="da65\opc65sc02.c" />
@ -114,6 +115,7 @@
<ClInclude Include="da65\opc4510.h" />
<ClInclude Include="da65\opc6502.h" />
<ClInclude Include="da65\opc6502x.h" />
<ClInclude Include="da65\opc6502dtv.h" />
<ClInclude Include="da65\opc65816.h" />
<ClInclude Include="da65\opc65c02.h" />
<ClInclude Include="da65\opc65sc02.h" />

308
src/da65/opc6502dtv.c Normal file
View File

@ -0,0 +1,308 @@
/*****************************************************************************/
/* */
/* opc6502dtv.c */
/* */
/* 6502 opcode description table with NMOS illegals and DTV opcodes */
/* */
/* */
/* */
/* (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 "opc6502dtv.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Descriptions for all opcodes. Base table from opc6502.c with illegal
** opcodes from http://www.oxyron.de/html/opcodes02.html and DTV opcodes
*/
const OpcDesc OpcTable_6502DTV[256] = {
{ "brk", 1, flNone, OH_Implicit }, /* $00 */
{ "ora", 2, flUseLabel, OH_DirectXIndirect }, /* $01 */
{ "jam", 1, flNone, OH_Implicit }, /* $02 */
{ "slo", 2, flUseLabel, OH_DirectXIndirect }, /* $03 */
{ "nop", 2, flUseLabel, OH_Direct }, /* $04 */
{ "ora", 2, flUseLabel, OH_Direct }, /* $05 */
{ "asl", 2, flUseLabel, OH_Direct }, /* $06 */
{ "slo", 2, flUseLabel, OH_Direct }, /* $07 */
{ "php", 1, flNone, OH_Implicit }, /* $08 */
{ "ora", 2, flNone, OH_Immediate }, /* $09 */
{ "asl", 1, flNone, OH_Accumulator }, /* $0a */
{ "anc", 2, flNone, OH_Immediate }, /* $0b */
{ "nop", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $0c */
{ "ora", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $0d */
{ "asl", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $0e */
{ "slo", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $0f */
{ "bpl", 2, flLabel, OH_Relative }, /* $10 */
{ "ora", 2, flUseLabel, OH_DirectIndirectY }, /* $11 */
{ "bra", 2, flLabel, OH_Relative }, /* $12 */
{ "slo", 2, flUseLabel, OH_DirectIndirectY }, /* $13 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $14 */
{ "ora", 2, flUseLabel, OH_DirectX }, /* $15 */
{ "asl", 2, flUseLabel, OH_DirectX }, /* $16 */
{ "slo", 2, flUseLabel, OH_DirectX }, /* $17 */
{ "clc", 1, flNone, OH_Implicit }, /* $18 */
{ "ora", 3, flUseLabel, OH_AbsoluteY }, /* $19 */
{ "nop", 1, flNone, OH_Implicit }, /* $1a */
{ "slo", 3, flUseLabel, OH_AbsoluteY }, /* $1b */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $1c */
{ "ora", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $1d */
{ "asl", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $1e */
{ "slo", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $1f */
{ "jsr", 3, flLabel, OH_Absolute }, /* $20 */
{ "and", 2, flUseLabel, OH_DirectXIndirect }, /* $21 */
{ "jam", 1, flNone, OH_Implicit, }, /* $22 */
{ "rla", 2, flUseLabel, OH_DirectXIndirect }, /* $23 */
{ "bit", 2, flUseLabel, OH_Direct }, /* $24 */
{ "and", 2, flUseLabel, OH_Direct }, /* $25 */
{ "rol", 2, flUseLabel, OH_Direct }, /* $26 */
{ "rla", 2, flUseLabel, OH_Direct }, /* $27 */
{ "plp", 1, flNone, OH_Implicit }, /* $28 */
{ "and", 2, flNone, OH_Immediate }, /* $29 */
{ "rol", 1, flNone, OH_Accumulator }, /* $2a */
{ "anc", 2, flNone, OH_Immediate }, /* $2b */
{ "bit", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $2c */
{ "and", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $2d */
{ "rol", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $2e */
{ "rla", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $2f */
{ "bmi", 2, flLabel, OH_Relative }, /* $30 */
{ "and", 2, flUseLabel, OH_DirectIndirectY }, /* $31 */
{ "sac", 2, flNone, OH_Immediate }, /* $32 */
{ "rla", 2, flUseLabel, OH_DirectIndirectY }, /* $33 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $34 */
{ "and", 2, flUseLabel, OH_DirectX }, /* $35 */
{ "rol", 2, flUseLabel, OH_DirectX }, /* $36 */
{ "rla", 2, flUseLabel, OH_DirectX }, /* $37 */
{ "sec", 1, flNone, OH_Implicit }, /* $38 */
{ "and", 3, flUseLabel, OH_AbsoluteY }, /* $39 */
{ "nop", 1, flNone, OH_Implicit }, /* $3a */
{ "rla", 3, flUseLabel, OH_AbsoluteY }, /* $3b */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $3c */
{ "and", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $3d */
{ "rol", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $3e */
{ "rla", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $3f */
{ "rti", 1, flNone, OH_Rts }, /* $40 */
{ "eor", 2, flUseLabel, OH_DirectXIndirect }, /* $41 */
{ "sir", 1, flNone, OH_Implicit }, /* $42 */
{ "sre", 2, flUseLabel, OH_DirectXIndirect }, /* $43 */
{ "nop", 2, flUseLabel, OH_Direct }, /* $44 */
{ "eor", 2, flUseLabel, OH_Direct }, /* $45 */
{ "lsr", 2, flUseLabel, OH_Direct }, /* $46 */
{ "sre", 2, flUseLabel, OH_Direct }, /* $47 */
{ "pha", 1, flNone, OH_Implicit }, /* $48 */
{ "eor", 2, flNone, OH_Immediate }, /* $49 */
{ "lsr", 1, flNone, OH_Accumulator }, /* $4a */
{ "alr", 2, flNone, OH_Immediate }, /* $4b */
{ "jmp", 3, flLabel, OH_JmpAbsolute }, /* $4c */
{ "eor", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $4d */
{ "lsr", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $4e */
{ "sre", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $4f */
{ "bvc", 2, flLabel, OH_Relative }, /* $50 */
{ "eor", 2, flUseLabel, OH_DirectIndirectY }, /* $51 */
{ "jam", 1, flNone, OH_Implicit }, /* $52 */
{ "sre", 2, flUseLabel, OH_DirectIndirectY }, /* $53 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $54 */
{ "eor", 2, flUseLabel, OH_DirectX }, /* $55 */
{ "lsr", 2, flUseLabel, OH_DirectX }, /* $56 */
{ "sre", 2, flUseLabel, OH_DirectX }, /* $57 */
{ "cli", 1, flNone, OH_Implicit }, /* $58 */
{ "eor", 3, flUseLabel, OH_AbsoluteY }, /* $59 */
{ "nop", 1, flNone, OH_Implicit }, /* $5a */
{ "sre", 3, flUseLabel, OH_AbsoluteY }, /* $5b */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $5c */
{ "eor", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $5d */
{ "lsr", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $5e */
{ "sre", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $5f */
{ "rts", 1, flNone, OH_Rts }, /* $60 */
{ "adc", 2, flUseLabel, OH_DirectXIndirect }, /* $61 */
{ "jam", 1, flNone, OH_Implicit }, /* $62 */
{ "rra", 2, flUseLabel, OH_DirectXIndirect }, /* $63 */
{ "nop", 2, flUseLabel, OH_Direct }, /* $64 */
{ "adc", 2, flUseLabel, OH_Direct }, /* $65 */
{ "ror", 2, flUseLabel, OH_Direct }, /* $66 */
{ "rra", 2, flUseLabel, OH_Direct }, /* $67 */
{ "pla", 1, flNone, OH_Implicit }, /* $68 */
{ "adc", 2, flNone, OH_Immediate }, /* $69 */
{ "ror", 1, flNone, OH_Accumulator }, /* $6a */
{ "arr", 2, flNone, OH_Immediate }, /* $6b */
{ "jmp", 3, flLabel, OH_JmpAbsoluteIndirect }, /* $6c */
{ "adc", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $6d */
{ "ror", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $6e */
{ "rra", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $6f */
{ "bvs", 2, flLabel, OH_Relative }, /* $70 */
{ "adc", 2, flUseLabel, OH_DirectIndirectY }, /* $71 */
{ "jam", 1, flNone, OH_Implicit }, /* $72 */
{ "rra", 2, flUseLabel, OH_DirectIndirectY }, /* $73 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $74 */
{ "adc", 2, flUseLabel, OH_DirectX }, /* $75 */
{ "ror", 2, flUseLabel, OH_DirectX }, /* $76 */
{ "rra", 2, flUseLabel, OH_DirectX }, /* $77 */
{ "sei", 1, flNone, OH_Implicit }, /* $78 */
{ "adc", 3, flUseLabel, OH_AbsoluteY }, /* $79 */
{ "nop", 1, flNone, OH_Implicit }, /* $7a */
{ "rra", 3, flUseLabel, OH_AbsoluteY }, /* $7b */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $7c */
{ "adc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $7d */
{ "ror", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $7e */
{ "rra", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $7f */
{ "nop", 2, flNone, OH_Immediate }, /* $80 */
{ "sta", 2, flUseLabel, OH_DirectXIndirect }, /* $81 */
{ "nop", 2, flNone, OH_Immediate }, /* $82 */
{ "sax", 2, flUseLabel, OH_DirectXIndirect }, /* $83 */
{ "sty", 2, flUseLabel, OH_Direct }, /* $84 */
{ "sta", 2, flUseLabel, OH_Direct }, /* $85 */
{ "stx", 2, flUseLabel, OH_Direct }, /* $86 */
{ "sax", 2, flUseLabel, OH_Direct }, /* $87 */
{ "dey", 1, flNone, OH_Implicit }, /* $88 */
{ "nop", 2, flNone, OH_Immediate }, /* $89 */
{ "txa", 1, flNone, OH_Implicit }, /* $8a */
{ "xaa", 2, flNone, OH_Immediate }, /* $8b */
{ "sty", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $8c */
{ "sta", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $8d */
{ "stx", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $8e */
{ "sax", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $8f */
{ "bcc", 2, flLabel, OH_Relative }, /* $90 */
{ "sta", 2, flUseLabel, OH_DirectIndirectY }, /* $91 */
{ "jam", 1, flNone, OH_Implicit }, /* $92 */
{ "ahx", 2, flUseLabel, OH_DirectIndirectY }, /* $93 */
{ "sty", 2, flUseLabel, OH_DirectX }, /* $94 */
{ "sta", 2, flUseLabel, OH_DirectX }, /* $95 */
{ "stx", 2, flUseLabel, OH_DirectY }, /* $96 */
{ "sax", 2, flUseLabel, OH_DirectY }, /* $97 */
{ "tya", 1, flNone, OH_Implicit }, /* $98 */
{ "sta", 3, flUseLabel, OH_AbsoluteY }, /* $99 */
{ "txs", 1, flNone, OH_Implicit }, /* $9a */
{ "tas", 3, flUseLabel, OH_AbsoluteY }, /* $9b */
{ "shy", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $9c */
{ "sta", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $9d */
{ "shx", 3, flUseLabel, OH_AbsoluteY }, /* $9e */
{ "ahx", 3, flUseLabel, OH_AbsoluteY }, /* $9f */
{ "ldy", 2, flNone, OH_Immediate }, /* $a0 */
{ "lda", 2, flUseLabel, OH_DirectXIndirect }, /* $a1 */
{ "ldx", 2, flNone, OH_Immediate }, /* $a2 */
{ "lax", 2, flUseLabel, OH_DirectXIndirect }, /* $a3 */
{ "ldy", 2, flUseLabel, OH_Direct }, /* $a4 */
{ "lda", 2, flUseLabel, OH_Direct }, /* $a5 */
{ "ldx", 2, flUseLabel, OH_Direct }, /* $a6 */
{ "lax", 2, flUseLabel, OH_Direct }, /* $a7 */
{ "tay", 1, flNone, OH_Implicit }, /* $a8 */
{ "lda", 2, flNone, OH_Immediate }, /* $a9 */
{ "tax", 1, flNone, OH_Implicit }, /* $aa */
{ "lax", 2, flNone, OH_Immediate }, /* $ab */
{ "ldy", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ac */
{ "lda", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ad */
{ "ldx", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ae */
{ "lax", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $af */
{ "bcs", 2, flLabel, OH_Relative }, /* $b0 */
{ "lda", 2, flUseLabel, OH_DirectIndirectY }, /* $b1 */
{ "jam", 1, flNone, OH_Implicit }, /* $b2 */
{ "lax", 2, flUseLabel, OH_DirectIndirectY }, /* $b3 */
{ "ldy", 2, flUseLabel, OH_DirectX }, /* $b4 */
{ "lda", 2, flUseLabel, OH_DirectX }, /* $b5 */
{ "ldx", 2, flUseLabel, OH_DirectY }, /* $b6 */
{ "lax", 2, flUseLabel, OH_DirectY }, /* $b7 */
{ "clv", 1, flNone, OH_Implicit }, /* $b8 */
{ "lda", 3, flUseLabel, OH_AbsoluteY }, /* $b9 */
{ "tsx", 1, flNone, OH_Implicit }, /* $ba */
{ "las", 3, flUseLabel, OH_AbsoluteY }, /* $bb */
{ "ldy", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $bc */
{ "lda", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $bd */
{ "ldx", 3, flUseLabel|flAbsOverride, OH_AbsoluteY }, /* $be */
{ "lax", 3, flUseLabel|flAbsOverride, OH_AbsoluteY }, /* $bf */
{ "cpy", 2, flNone, OH_Immediate }, /* $c0 */
{ "cmp", 2, flUseLabel, OH_DirectXIndirect }, /* $c1 */
{ "nop", 2, flNone, OH_Immediate }, /* $c2 */
{ "dcp", 2, flUseLabel, OH_DirectXIndirect }, /* $c3 */
{ "cpy", 2, flUseLabel, OH_Direct }, /* $c4 */
{ "cmp", 2, flUseLabel, OH_Direct }, /* $c5 */
{ "dec", 2, flUseLabel, OH_Direct }, /* $c6 */
{ "dcp", 2, flUseLabel, OH_Direct }, /* $c7 */
{ "iny", 1, flNone, OH_Implicit }, /* $c8 */
{ "cmp", 2, flNone, OH_Immediate }, /* $c9 */
{ "dex", 1, flNone, OH_Implicit }, /* $ca */
{ "axs", 2, flNone, OH_Immediate }, /* $cb */
{ "cpy", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $cc */
{ "cmp", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $cd */
{ "dec", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ce */
{ "dcp", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $cf */
{ "bne", 2, flLabel, OH_Relative }, /* $d0 */
{ "cmp", 2, flUseLabel, OH_DirectIndirectY }, /* $d1 */
{ "jam", 1, flNone, OH_Implicit }, /* $d2 */
{ "dcp", 2, flUseLabel, OH_DirectIndirectY }, /* $d3 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $d4 */
{ "cmp", 2, flUseLabel, OH_DirectX }, /* $d5 */
{ "dec", 2, flUseLabel, OH_DirectX }, /* $d6 */
{ "dcp", 2, flUseLabel, OH_DirectX }, /* $d7 */
{ "cld", 1, flNone, OH_Implicit }, /* $d8 */
{ "cmp", 3, flUseLabel, OH_AbsoluteY }, /* $d9 */
{ "nop", 1, flNone, OH_Implicit }, /* $da */
{ "dcp", 3, flUseLabel, OH_AbsoluteY }, /* $db */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $dc */
{ "cmp", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $dd */
{ "dec", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $de */
{ "dcp", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $df */
{ "cpx", 2, flNone, OH_Immediate }, /* $e0 */
{ "sbc", 2, flUseLabel, OH_DirectXIndirect }, /* $e1 */
{ "nop", 2, flNone, OH_Immediate }, /* $e2 */
{ "isc", 2, flUseLabel, OH_DirectXIndirect }, /* $e3 */
{ "cpx", 2, flUseLabel, OH_Direct }, /* $e4 */
{ "sbc", 2, flUseLabel, OH_Direct }, /* $e5 */
{ "inc", 2, flUseLabel, OH_Direct }, /* $e6 */
{ "isc", 2, flUseLabel, OH_Direct }, /* $e7 */
{ "inx", 1, flNone, OH_Implicit }, /* $e8 */
{ "sbc", 2, flNone, OH_Immediate }, /* $e9 */
{ "nop", 1, flNone, OH_Implicit }, /* $ea */
{ "sbc", 2, flNone, OH_Immediate }, /* $eb */
{ "cpx", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ec */
{ "sbc", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ed */
{ "inc", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ee */
{ "isc", 3, flUseLabel|flAbsOverride, OH_Absolute }, /* $ef */
{ "beq", 2, flLabel, OH_Relative }, /* $f0 */
{ "sbc", 2, flUseLabel, OH_DirectIndirectY }, /* $f1 */
{ "jam", 1, flNone, OH_Implicit }, /* $f2 */
{ "isc", 2, flUseLabel, OH_DirectIndirectY }, /* $f3 */
{ "nop", 2, flUseLabel, OH_DirectX }, /* $f4 */
{ "sbc", 2, flUseLabel, OH_DirectX }, /* $f5 */
{ "inc", 2, flUseLabel, OH_DirectX }, /* $f6 */
{ "isc", 2, flUseLabel, OH_DirectX }, /* $f7 */
{ "sed", 1, flNone, OH_Implicit }, /* $f8 */
{ "sbc", 3, flUseLabel, OH_AbsoluteY }, /* $f9 */
{ "nop", 1, flNone, OH_Implicit }, /* $fa */
{ "isc", 3, flUseLabel, OH_AbsoluteY }, /* $fb */
{ "nop", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fc */
{ "sbc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fd */
{ "inc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $fe */
{ "isc", 3, flUseLabel|flAbsOverride, OH_AbsoluteX }, /* $ff */
};

61
src/da65/opc6502dtv.h Normal file
View File

@ -0,0 +1,61 @@
/*****************************************************************************/
/* */
/* opc6502dtv.h */
/* */
/* 6502 opcode description table with NMOS illegals and DTV opcodes */
/* */
/* */
/* */
/* (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 OPC6502DTV_H
#define OPC6502DTV_H
#include "opcdesc.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Descriptions for all opcodes */
extern const OpcDesc OpcTable_6502DTV[256];
/* End of opc6502dtv.h */
#endif

View File

@ -38,6 +38,7 @@
#include "opc4510.h"
#include "opc6502.h"
#include "opc6502x.h"
#include "opc6502dtv.h"
#include "opc65816.h"
#include "opc65c02.h"
#include "opc65sc02.h"
@ -70,6 +71,7 @@ void SetOpcTable (cpu_t CPU)
switch (CPU) {
case CPU_6502: OpcTable = OpcTable_6502; break;
case CPU_6502X: OpcTable = OpcTable_6502X; break;
case CPU_6502DTV: OpcTable = OpcTable_6502DTV; break;
case CPU_65SC02: OpcTable = OpcTable_65SC02; break;
case CPU_65C02: OpcTable = OpcTable_65C02; break;
case CPU_HUC6280: OpcTable = OpcTable_HuC6280; break;