]> Shamusworld >> Repos - rmac/blobdiff - rmac.c
Small fix for FU_JR fixups.
[rmac] / rmac.c
diff --git a/rmac.c b/rmac.c
index 3cc24f4e3ee74dc80416735311ede284c72cb74d..eab212522bc526d46346baa01c2c4de910fb607d 100644 (file)
--- a/rmac.c
+++ b/rmac.c
@@ -308,14 +308,16 @@ char * amem(LONG amount)
 {
        char * p;
 
-       if (amount & 1)                                           // Keep word alignment
-               ++amount;
+//     if (amount & 1)                                                         // Keep word alignment
+//             amount++;
+       amount = (amount + 1) & ~(0x01);                        // Keep word alignment
 
+       // Honor *small* request (< 64 bytes)
        if (amount < A_THRESH)
-       {                                  // Honor *small* request
+       {
                if (a_amount < amount)
                {
-                       a_ptr = amem(A_AMOUNT);
+                       a_ptr = amem(A_AMOUNT);                         // Allocate 4K bytes
                        a_amount = A_AMOUNT;
                }
 
@@ -325,11 +327,11 @@ char * amem(LONG amount)
        }
        else
        {
-               amemtot += amount;                                    // Bump total alloc
-               p = (char *)malloc(amount);                           // Get memory from malloc
+               amemtot += amount;                                              // Bump total alloc
+               p = (char *)malloc(amount);                             // Get memory from malloc
 
-               if ((LONG)p == (LONG)NULL)
-                       fatal("memory exhausted");
+               if (p == NULL)
+                       fatal("Memory exhausted!");
 
                memset(p, 0, amount);
        }
@@ -561,7 +563,7 @@ int process(int argc, char ** argv)
        in_main = 0;
 
        // Initialise modules
-       init_sym();                                             // Symbol table
+       InitSymbolTable();                              // Symbol table
        init_token();                                   // Tokenizer
        init_procln();                                  // Line processor
        init_expr();                                    // Expression analyzer
@@ -599,7 +601,7 @@ int process(int argc, char ** argv)
 
                                if (sy == NULL)
                                {
-                                       sy = newsym(argv[argno] + 2, LABEL, 0);
+                                       sy = NewSymbol(argv[argno] + 2, LABEL, 0);
                                        sy->svalue = 0;
                                }
 
@@ -791,8 +793,8 @@ int process(int argc, char ** argv)
        //       (`lo68' format, extended (postfix) format....)
        // (2)   generate the output file image and symbol table;
        // (3)   generate relocation information from left-over fixups.
-       fixups();                                                // Do all fixups
-       stopmark();                                              // Stop mark tape-recorder
+       ResolveAllFixups();                                             // Do all fixups
+       stopmark();                                                             // Stop mark tape-recorder
 
        if (errcnt == 0)
        {