From fb3833c56f054d76f359c38edb16a328d03dffca Mon Sep 17 00:00:00 2001 From: ggn Date: Sat, 6 Mar 2021 20:18:43 +0200 Subject: [PATCH] Proposed fix for bug #182 (ds.X doesn't work with relative expressions) --- direct.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/direct.c b/direct.c index d6d6c3f..7ba517e 100644 --- a/direct.c +++ b/direct.c @@ -1130,6 +1130,7 @@ int d_ds(WORD siz) DEBUG { printf("Directive: .ds.[size] = %u, sloc = $%X\n", siz, sloc); } uint64_t eval; + WORD eattr; if ((cursect & (M6502 | M56KPXYL)) == 0) { @@ -1137,9 +1138,9 @@ int d_ds(WORD siz) auto_even(); } - if (abs_expr(&eval) != OK) - return 0; - + if (expr(exprbuf, &eval, &eattr, NULL) < 0) + return ERROR; + // Check to see if the value being passed in is negative (who the hell does // that?--nobody does; it's the code gremlins, or rum, what does it) // N.B.: Since 'eval' is of type uint64_t, if it goes negative, it will -- 2.30.0.windows.2