+
+ Conditional assembly: Check if the assembler is currently in 6502DTV mode
+ (see command).
+
+
.IFPSC02
Conditional assembly: Check if the assembler is currently in 65SC02 mode
@@ -3585,6 +3593,14 @@ Here's a list of all control commands and a description, what they do:
+.PDTV
+
+ Enable the 6502DTV instruction set. This is a superset of the 6502
+ instruction set.
+
+ See:
+
+
.POPCPU
Pop the last CPU setting from the stack, and activate it.
@@ -3848,10 +3864,11 @@ Here's a list of all control commands and a description, what they do:
Switch the CPU instruction set. The command is followed by a string that
specifies the CPU. Possible values are those that can also be supplied to
the command line option,
- namely: 6502, 6502X, 65SC02, 65C02, 65816, 4510 and HuC6280.
+ namely: 6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, 4510 and HuC6280.
See: ,
,
+ ,
,
,
,
@@ -4586,6 +4603,7 @@ each supported CPU a constant similar to
CPU_SWEET16
CPU_HUC6280
CPU_4510
+ CPU_6502DTV
is defined. These constants may be used to determine the exact type of the
@@ -4600,6 +4618,7 @@ another constant is defined:
CPU_ISET_SWEET16
CPU_ISET_HUC6280
CPU_ISET_4510
+ CPU_ISET_6502DTV
The value read from the / pseudo variable may
diff --git a/src/ca65/condasm.c b/src/ca65/condasm.c
index b8bda4c7d..6198f4017 100644
--- a/src/ca65/condasm.c
+++ b/src/ca65/condasm.c
@@ -416,6 +416,16 @@ void DoConditionals (void)
CalcOverallIfCond ();
break;
+ case TOK_IFPDTV:
+ D = AllocIf (".IFPDTV", 1);
+ NextTok ();
+ if (IfCond) {
+ SetIfCond (D, GetCPU() == CPU_6502DTV);
+ }
+ ExpectSep ();
+ CalcOverallIfCond ();
+ break;
+
case TOK_IFPSC02:
D = AllocIf (".IFPSC02", 1);
NextTok ();
@@ -470,6 +480,7 @@ int CheckConditionals (void)
case TOK_IFP4510:
case TOK_IFP816:
case TOK_IFPC02:
+ case TOK_IFPDTV:
case TOK_IFPSC02:
case TOK_IFREF:
DoConditionals ();
diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c
index 5b2ef0573..26d01cbf1 100644
--- a/src/ca65/pseudo.c
+++ b/src/ca65/pseudo.c
@@ -1552,6 +1552,14 @@ static void DoP4510 (void)
+static void DoPDTV (void)
+/* Switch to C64DTV CPU */
+{
+ SetCPU (CPU_6502DTV);
+}
+
+
+
static void DoPageLength (void)
/* Set the page length for the listing */
{
@@ -2058,6 +2066,7 @@ static CtrlDesc CtrlCmdTab [] = {
{ ccKeepToken, DoConditionals }, /* .IFP4510 */
{ ccKeepToken, DoConditionals }, /* .IFP816 */
{ ccKeepToken, DoConditionals }, /* .IFPC02 */
+ { ccKeepToken, DoConditionals }, /* .IFPDTV */
{ ccKeepToken, DoConditionals }, /* .IFPSC02 */
{ ccKeepToken, DoConditionals }, /* .IFREF */
{ ccNone, DoImport },
@@ -2091,6 +2100,7 @@ static CtrlDesc CtrlCmdTab [] = {
{ ccNone, DoPageLength },
{ ccNone, DoUnexpected }, /* .PARAMCOUNT */
{ ccNone, DoPC02 },
+ { ccNone, DoPDTV },
{ ccNone, DoPopCPU },
{ ccNone, DoPopSeg },
{ ccNone, DoProc },
diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c
index 361a817c1..fb9905809 100644
--- a/src/ca65/scanner.c
+++ b/src/ca65/scanner.c
@@ -219,6 +219,7 @@ struct DotKeyword {
{ ".IFP4510", TOK_IFP4510 },
{ ".IFP816", TOK_IFP816 },
{ ".IFPC02", TOK_IFPC02 },
+ { ".IFPDTV", TOK_IFPDTV },
{ ".IFPSC02", TOK_IFPSC02 },
{ ".IFREF", TOK_IFREF },
{ ".IMPORT", TOK_IMPORT },
@@ -258,6 +259,7 @@ struct DotKeyword {
{ ".PAGELENGTH", TOK_PAGELENGTH },
{ ".PARAMCOUNT", TOK_PARAMCOUNT },
{ ".PC02", TOK_PC02 },
+ { ".PDTV", TOK_PDTV },
{ ".POPCPU", TOK_POPCPU },
{ ".POPSEG", TOK_POPSEG },
{ ".PROC", TOK_PROC },
diff --git a/src/ca65/token.h b/src/ca65/token.h
index 8998cc162..ab36028fd 100644
--- a/src/ca65/token.h
+++ b/src/ca65/token.h
@@ -196,6 +196,7 @@ typedef enum token_t {
TOK_IFP4510,
TOK_IFP816,
TOK_IFPC02,
+ TOK_IFPDTV,
TOK_IFPSC02,
TOK_IFREF,
TOK_IMPORT,
@@ -229,6 +230,7 @@ typedef enum token_t {
TOK_PAGELENGTH,
TOK_PARAMCOUNT,
TOK_PC02,
+ TOK_PDTV,
TOK_POPCPU,
TOK_POPSEG,
TOK_PROC,