]> Shamusworld >> Repos - rmac/blobdiff - eagen0.c
Version bump for last commit + ws cleanups. Now at v2.0.18.
[rmac] / eagen0.c
index 533dfa2e4eafadeca90506d770efbb32326ae1ee..1de45e35475ab741b4dbccd1360a043c59cc0a0c 100644 (file)
--- a/eagen0.c
+++ b/eagen0.c
@@ -2,7 +2,7 @@
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // EAGEN0.C - Effective Address Code Generation
 //            Generated Code for eaN (Included twice by "eagen.c")
-// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2020 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -40,7 +40,7 @@ int eaNgen(WORD siz)
                        if (tdb)
                                MarkRelocatable(cursect, sloc, tdb, MWORD, NULL);
 
-                       if ((v == 0) && CHECK_OPTS(OPT_INDIRECT_DISP) && !movep)
+                       if ((v == 0) && CHECK_OPTS(OPT_OUTER_DISP) && !movep)
                        {
                                // If expr is 0, size optimise the opcode. Generally the lower
                                // 6 bits of the opcode for expr(ax) are 101rrr where rrr=the
@@ -64,7 +64,7 @@ int eaNgen(WORD siz)
                                        chptr_opcode[1] |= 0x0080 & 255;          // slap in 010 bits
                                }
 
-                               if (sbra_flag)
+                               if (optim_warn_flag)
                                        warn("0(An) converted to (An)");
 
                                return OK;
@@ -326,6 +326,12 @@ int eaNgen(WORD siz)
        case ABSL:
                if (w) // Defined
                {
+                       if (CHECK_OPTS(OPT_PC_RELATIVE))
+                       {
+                               if (aNexattr & (DEFINED | REFERENCED | EQUATED) == DEFINED | REFERENCED)
+                                       return error("relocation not allowed");
+                       }
+
                        if (tdb)
                                MarkRelocatable(cursect, sloc, tdb, MLONG, NULL);