From e1dcecf9d221f030c041657c5f69f15236cd3c43 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 6 Sep 2018 11:48:23 +0100 Subject: Made '$' expansion account for bank in 24-bit address mode. --- src/label.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/label.c') 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 */ -- cgit v1.2.3