aboutsummaryrefslogtreecommitdiff
path: root/src/casm.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-12 15:28:32 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-12 15:28:32 +0100
commit5e6a1c3434b96ea16485b160c25732df3b00b2b8 (patch)
treec86331cb1c74fbff18a8b7ef0ebd5989a0a1f182 /src/casm.c
parente60cc5a36c148ef5ea0e38bcc848cf32f2b54a18 (diff)
Started on SPC700
Also: * Added offset to import command. Realised fairly useless, but may as well keep it. * Added setting of address space size to state for PC.
Diffstat (limited to 'src/casm.c')
-rw-r--r--src/casm.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/casm.c b/src/casm.c
index 9e5c68e..1fa6d03 100644
--- a/src/casm.c
+++ b/src/casm.c
@@ -48,6 +48,7 @@
#include "6502.h"
#include "gbcpu.h"
#include "65c816.h"
+#include "spc700.h"
/* ---------------------------------------- MACROS
@@ -76,7 +77,7 @@ static const char *casm_usage =
typedef struct
{
const char *name;
- int mem_size;
+ int address_space;
WordMode word_mode;
void (*init)(void);
const ValueTable *(*options)(void);
@@ -124,6 +125,12 @@ static const CPU cpu_table[]=
LSB_Word,
Init_65c816, Options_65c816, SetOption_65c816, Handler_65c816
},
+ {
+ "spc700",
+ 0x10000,
+ LSB_Word,
+ Init_SPC700, Options_SPC700, SetOption_SPC700, Handler_SPC700
+ },
{NULL}
};
@@ -416,6 +423,7 @@ static CommandStatus ARCH(const char *label, int argc, char *argv[],
{
cpu = cpu_table + f;
SetWordMode(cpu->word_mode);
+ SetAddressSpace(cpu->address_space);
return CMD_OK;
}
}
@@ -509,25 +517,22 @@ static CommandStatus NULLCMD(const char *label, int argc, char *argv[],
static CommandStatus IMPORT(const char *label, int argc, char *argv[],
int quoted[], char *err, size_t errsize)
{
+ LibLoadOption opt = LibLoadAll;
+ int offset = 0;
+
CMD_ARGC_CHECK(2);
- if (argc == 3)
+ if (argc >= 3 && CompareString(argv[2], "labels"))
{
- if (CompareString(argv[2], "labels"))
- {
- return LibLoad(argv[1], LibLoadLabels, err, errsize) ?
- CMD_OK : CMD_FAILED;
- }
- else
- {
- snprintf(err, errsize, "%s: unknown argument %s", argv[0], argv[2]);
- return CMD_FAILED;
- }
+ opt = LibLoadLabels;
}
- else
+
+ if (argc >= 4)
{
- return LibLoad(argv[1], LibLoadAll, err, errsize) ? CMD_OK : CMD_FAILED;
+ CMD_EXPR(argv[3], offset);
}
+
+ return LibLoad(argv[1], opt, offset, err, errsize) ? CMD_OK : CMD_FAILED;
}
@@ -711,6 +716,7 @@ static void InitProcessors(void)
}
SetWordMode(cpu->word_mode);
+ SetAddressSpace(cpu->address_space);
}