aboutsummaryrefslogtreecommitdiff
path: root/src/65c816.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-03 14:14:31 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-03 14:14:31 +0100
commit3b18081f6cd84813b7fc142ae6e6ffe2f37bebeb (patch)
treea661f5671277a78f71b80d695acc14d1c2515468 /src/65c816.c
parent6b970e749e720404d08cec565fe0157d20fdeaef (diff)
Checked 65c816 output using dispel.
Diffstat (limited to 'src/65c816.c')
-rwxr-xr-xsrc/65c816.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/65c816.c b/src/65c816.c
index 6305dd0..a72491f 100755
--- a/src/65c816.c
+++ b/src/65c816.c
@@ -733,7 +733,7 @@ static CommandStatus BIT(const char *label, int argc, char *argv[],
case DIRECT_PAGE_INDEX_X:
PCWrite(0x34);
- PCWriteWord(address);
+ PCWrite(address);
return CMD_OK;
case ABSOLUTE_INDEX_X:
@@ -1593,6 +1593,39 @@ static CommandStatus PER(const char *label, int argc, char *argv[],
}
}
+static CommandStatus OP_SIGNATURE(const char *label, int argc, char *argv[],
+ int quoted[], char *err, size_t errsize)
+{
+ address_mode_t mode;
+ int address;
+ int opcode;
+
+ CMD_ADDRESS_MODE(mode, address);
+
+ if (CompareString(argv[0], "WDM"))
+ {
+ opcode = 0x42;
+ }
+ else
+ {
+ opcode = 0x00;
+ }
+
+ switch(mode)
+ {
+ case IMMEDIATE:
+ case ACCUMULATOR:
+ PCWrite(opcode);
+ PCWrite(0x00);
+ return CMD_OK;
+
+ default:
+ PCWrite(opcode);
+ PCWrite(address);
+ return CMD_OK;
+ }
+}
+
/* ---------------------------------------- OPCODE TABLES
*/
typedef struct
@@ -1656,11 +1689,9 @@ static const OpcodeTable implied_opcodes[] =
{"CLV", 0xb8},
{"CLD", 0xd8},
{"SED", 0xf8},
- {"BRK", 0x00},
{"RTI", 0x40},
{"RTL", 0x6b},
{"RTS", 0x60},
- {"WDM", 0x42},
{"STP", 0xdb},
{"WAI", 0xcb},
{NULL}
@@ -1737,6 +1768,10 @@ static const HandlerTable handler_table[] =
{"PEA", PEA},
{"PER", PER},
{"PEI", PEI},
+
+ {"WDM", OP_SIGNATURE},
+ {"BRK", OP_SIGNATURE},
+
{NULL}
};