]> Shamusworld >> Repos - rmac/blobdiff - amode.c
EOY minor update.
[rmac] / amode.c
diff --git a/amode.c b/amode.c
index 7ba585349883a49b2fa1e897dd7060882f3a0e80..c930a9695269b2787e872b82a7ceb424e599e136 100644 (file)
--- a/amode.c
+++ b/amode.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // AMODE.C - Addressing Modes
-// Copyright (C) 199x Landon Dyer, 2011-2017 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
 //
@@ -61,7 +61,6 @@ WORD a1extension;                     // 020+ extension address word
 WORD am1_030;                          // ea bits for 020+ addressing modes
 
 int a2reg;                                     // Register for div.l (68020+)
-WORD mulmode;                          // to distinguish between 32 and 64 bit multiplications (68020+)
 
 int bfparam1;                          // bfxxx / fmove instruction parameter 1
 int bfparam2;                          // bfxxx / fmove instruction parameter 2
@@ -73,7 +72,7 @@ WORD bf0exattr;                               // Expression's attribute
 SYM * bf0esym;                         // External symbol involved in expr
 
 // Function prototypes
-int check030bf(void);
+int Check030Bitfield(void);
 
 
 //
@@ -133,7 +132,7 @@ int amode(int acount)
        // it's a bitfield instruction--check the parameters inside the {} block
        // for validity
        if (*tok == '{')
-               if (check030bf() == ERROR)
+               if (Check030Bitfield() == ERROR)
                        return ERROR;
 
        if ((acount == 0) || (*tok != ','))
@@ -171,7 +170,7 @@ int amode(int acount)
        // It's a bitfield instruction--check the parameters inside the {} block
        // for validity
        if (*tok == '{')
-        if (check030bf() == ERROR)
+        if (Check030Bitfield() == ERROR)
                return ERROR;
 
        // At this point, it is legal for 020+ to have a ':'. For example divu.l
@@ -185,26 +184,17 @@ int amode(int acount)
                tok++;  //eat the colon
 
                if ((*tok >= KW_D0) && (*tok <= KW_D7))
-               {
-                       a2reg = (*tok - KW_D0);
-                       mulmode = 1 << 10;
-               }
+                       a2reg = (*tok++) & 7;
                else if ((*tok >= KW_FP0) && (*tok <= KW_FP7))
-               {
-                       a2reg = (*tok - KW_FP0);
-                       mulmode = 1 << 10;
-               }
+                       a2reg = (*tok++) & 7;
                else
                        return error("a data or FPU register must follow a :");
-
-               *tok++;
        }
        else
        {
                // If no ':' is present then maybe we have something like divs.l d0,d1
                // which sould translate to divs.l d0,d1:d1
                a2reg = a1reg;
-               mulmode = 0;
        }
 
        nmodes = 2;
@@ -213,9 +203,6 @@ int amode(int acount)
        // Error messages:
 badmode:
        return error("addressing mode syntax");
-
-       //unmode:
-       //return error("unimplemented addressing mode");
 }
 
 
@@ -330,8 +317,8 @@ int fpu_reglist_left(WORD * a_rmask)
 int fpu_reglist_right(WORD * a_rmask)
 {
        static WORD msktab_plus[] = {
-               0x0001, 0x0002, 0x0004, 0x0008,
-               0x0010, 0x0020, 0x0040, 0x0080
+               0x0080, 0x0040, 0x0020, 0x0010,
+               0x0008, 0x0004, 0x0002, 0x0001
        };
 
        WORD rmask = 0;
@@ -382,7 +369,7 @@ int fpu_reglist_right(WORD * a_rmask)
 // bfxxx <ea>{param1,param2}
 // param1/2 are either data registers or immediate values
 //
-int check030bf(void)
+int Check030Bitfield(void)
 {
        PTR tp;
        CHECK00;