aboutsummaryrefslogtreecommitdiff
path: root/src/label.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-09-06 11:48:23 +0100
committerIan C <ianc@noddybox.co.uk>2018-09-06 11:48:23 +0100
commite1dcecf9d221f030c041657c5f69f15236cd3c43 (patch)
treea4ef1b1ac4e37d521acfad39c5465f173e1d90ca /src/label.c
parenta637b47b962e37d46c4ac7c54dd8090679a679da (diff)
Made '$' expansion account for bank in 24-bit address mode.V1.5
Diffstat (limited to 'src/label.c')
-rw-r--r--src/label.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/label.c b/src/label.c
index 946a6ea..72e752c 100644
--- a/src/label.c
+++ b/src/label.c
@@ -56,6 +56,8 @@ static char namespace[MAX_LABEL_SIZE + 1];
static Stack *stack;
+static int address24 = FALSE;
+
/* ---------------------------------------- PRIVATE FUNCTIONS
*/
@@ -297,7 +299,15 @@ int LabelExpand(const char *expr, int *result)
/* Current PC
*/
case '$':
- *result = PC();
+ if (address24)
+ {
+ *result = Bank() << 16 | PC();
+ }
+ else
+ {
+ *result = PC();
+ }
+
return TRUE;
default:
@@ -570,6 +580,12 @@ void LabelReadBlob(FILE *fp, int offset)
}
+void LabelSetAddress24(int onoff)
+{
+ address24 = onoff;
+}
+
+
/*
vim: ai sw=4 ts=8 expandtab
*/