diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-09-06 11:48:23 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-09-06 11:48:23 +0100 |
commit | e1dcecf9d221f030c041657c5f69f15236cd3c43 (patch) | |
tree | a4ef1b1ac4e37d521acfad39c5465f173e1d90ca /src/label.c | |
parent | a637b47b962e37d46c4ac7c54dd8090679a679da (diff) |
Made '$' expansion account for bank in 24-bit address mode.V1.5
Diffstat (limited to 'src/label.c')
-rw-r--r-- | src/label.c | 18 |
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 */ |