]> Shamusworld >> Repos - rmac/commitdiff
Proposed fix for bug #182 (ds.X doesn't work with relative expressions)
authorggn <ggn.dbug@gmail.com>
Sat, 6 Mar 2021 18:18:43 +0000 (20:18 +0200)
committerShamus Hammons <jlhamm@acm.org>
Mon, 30 May 2022 17:38:30 +0000 (12:38 -0500)
direct.c

index 809bb79090460d4632a7c397e5de0061819af491..e091bf89521c9e40e774179f71585e119f6425e7 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -1137,6 +1137,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)
        {
@@ -1144,9 +1145,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