]> Shamusworld >> Repos - rmac/blobdiff - direct.c
.equr overhaul part 4: handle equrundef (and the other permutations of the directive)
[rmac] / direct.c
index e3685d1c8eef7c245370338c30347b215c6f4994..e091bf89521c9e40e774179f71585e119f6425e7 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -645,8 +645,7 @@ allright:
                                        }
 
                                        lseek(fd, pos, SEEK_SET);
-                                       size -= pos;
-                                       if ((int64_t)size < 0)
+                                       if ((int64_t)(size - pos) < 0)
                                        {
                                                return error("requested incbin size out of range");
                                        }
@@ -1138,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)
        {
@@ -1145,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