]> Shamusworld >> Repos - rmac/blobdiff - amode.c
Roll back TOKENPTR changes and most of the .u32 changes weren't needed.
[rmac] / amode.c
diff --git a/amode.c b/amode.c
index 73f2bdaa15f19cdf0b671481eb69f59b8b939d52..7ba585349883a49b2fa1e897dd7060882f3a0e80 100644 (file)
--- a/amode.c
+++ b/amode.c
@@ -65,8 +65,8 @@ 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
-int bfval1;                                    //bfxxx / fmove value 1
-int bfval2;                                    //bfxxx / fmove value 2
+int bfval1;                                    // bfxxx / fmove value 1
+int bfval2;                                    // bfxxx / fmove value 2
 TOKEN bf0expr[EXPRSIZE];       // Expression
 uint64_t bf0exval;                     // Expression's value
 WORD bf0exattr;                                // Expression's attribute
@@ -384,18 +384,18 @@ int fpu_reglist_right(WORD * a_rmask)
 //
 int check030bf(void)
 {
+       PTR tp;
        CHECK00;
        tok++;
 
        if (*tok == CONST)
        {
-               tok++;
-               bfval1 = (int)*(uint64_t *)tok;
+               tp.u32 = tok + 1;
+               bfval1 = (int)*tp.u64++;
+               tok = tp.u32;
 
                // Do=0, offset=immediate - shift it to place
                bfparam1 = (0 << 11);
-               tok++;
-               tok++;
        }
        else if (*tok == SYMBOL)
        {
@@ -420,8 +420,9 @@ int check030bf(void)
        else
                return ERROR;
 
-       if (*tok==':')
-               tok++;  //eat the ':'
+       // Eat the ':', if any
+       if (*tok == ':')
+               tok++;
 
        if (*tok == '}' && tok[1] == EOL)
        {
@@ -432,13 +433,12 @@ int check030bf(void)
 
        if (*tok == CONST)
        {
-               tok++;
-               bfval2 = (int)*(uint64_t *)tok;
+               tp.u32 = tok + 1;
+               bfval2 = (int)*tp.u64++;
+               tok = tp.u32;
 
                // Do=0, offset=immediate - shift it to place
                bfparam2 = (0 << 5);
-               tok++;
-        tok++;
        }
        else if (*tok == SYMBOL)
        {
@@ -456,7 +456,7 @@ int check030bf(void)
        else if ((*tok >= KW_D0) && (*tok <= KW_D7))
        {
                // Do=1, offset=data register - shift it to place
-               bfval2 = ((*(int *)tok - 128));
+               bfval2 = (*(int *)tok - 128);
                bfparam2 = (1 << 5);
                tok++;
        }