aboutsummaryrefslogtreecommitdiff
path: root/src/casm.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-03-16 11:31:21 +0000
committerIan C <ianc@noddybox.co.uk>2016-03-16 11:31:21 +0000
commit4564c7906be89463b8f9637685e1785dd900f4b3 (patch)
treec80bcbcbca885485199ae77960570e973328c03a /src/casm.c
parente23a3e98bf4afc6bc900a427c20c01feac476d1a (diff)
Updated banking to work with output.
Diffstat (limited to 'src/casm.c')
-rw-r--r--src/casm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/casm.c b/src/casm.c
index 9f685f8..1340eb7 100644
--- a/src/casm.c
+++ b/src/casm.c
@@ -139,6 +139,27 @@ static CommandStatus ORG(const char *label, int argc, char *argv[],
LabelSet(label, result, ANY_LABEL);
}
+ /* See if an optional bank was supplied
+ */
+ if (argc > 2)
+ {
+ CMD_EXPR(argv[2], result);
+ SetAddressBank(result);
+ }
+
+ return CMD_OK;
+}
+
+static CommandStatus BANK(const char *label, int argc, char *argv[],
+ int quoted[], char *err, size_t errsize)
+{
+ int result;
+
+ CMD_ARGC_CHECK(2);
+ CMD_EXPR(argv[1], result);
+
+ SetAddressBank(result);
+
return CMD_OK;
}
@@ -410,6 +431,8 @@ static struct
{".eq", EQU},
{"org", ORG},
{".org", ORG},
+ {"bank", BANK},
+ {".bank", BANK},
{"ds", DS},
{".ds", DS},
{"defs", DS},