]> Shamusworld >> Repos - rmac/blobdiff - direct.c
(c) message in header files and doc mini adjustments.
[rmac] / direct.c
index 8d3d804330ad71f8080f232c0d2ef640fdd5cb39..5da6347f2a0ccab6d1f1ba5fe0e3fa4c34934603 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -1,13 +1,14 @@
 //
-// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
+// RMAC - Reboot's Macro Assembler for all Atari computers
 // DIRECT.C - Directive Handling
-// Copyright (C) 199x Landon Dyer, 2017 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
 
 #include "direct.h"
 #include "6502.h"
+#include "amode.h"
 #include "error.h"
 #include "expr.h"
 #include "listing.h"
@@ -31,6 +32,15 @@ char buffer[256];                    // Scratch buffer for messages
 // Function prototypes
 int d_unimpl(void);
 int d_68000(void);
+int d_68000(void);
+int d_68020(void);
+int d_68030(void);
+int d_68040(void);
+int d_68060(void);
+int d_68881(void);
+int d_68882(void);
+int d_56001(void);
+int d_nofpu(void);
 int d_bss(void);
 int d_data(void);
 int d_text(void);
@@ -66,6 +76,7 @@ int d_fail(void);
 int d_cstruct(void);
 int d_prgflags(void);
 int d_opt(void);
+int d_dsp(void);
 
 // Directive handler table
 int (*dirtab[])() = {
@@ -127,6 +138,14 @@ int (*dirtab[])() = {
        d_nojpad,                       // 55 .nojpad (deprecated)
        d_gpumain,                      // 56 .gpumain (deprecated)
        d_prgflags,                     // 57 .prgflags
+       d_68020,                        // 58 .68020
+       d_68030,                        // 59 .68030
+       d_68040,                        // 60 .68040
+       d_68060,                        // 61 .68060
+       d_68881,                        // 62 .68881
+       d_68882,                        // 63 .68882
+       d_56001,                        // 64 .56001
+       d_nofpu,                        // 65 nofpu
        d_opt,                          // 58 .opt
 };
 
@@ -929,7 +948,9 @@ int d_ds(WORD siz)
 
        // 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, that does it)
-       if (eval < 0)
+       // N.B.: Since VALUE is of type uint32_t, if it goes negative, it will have
+       //       its high bit set.
+       if (eval & 0x80000000)
                return error("negative sizes not allowed");
 
        // In non-TDB section (BSS, ABS and M6502) just advance the location
@@ -1039,15 +1060,15 @@ int d_dc(WORD siz)
                        }
                        else
                        {
+                               if (tdb)
+                                       return error("non-absolute byte value");
+
                                if (eval + 0x100 >= 0x200)
                                {
                                        sprintf(buffer, "%s (value = $%X)", range_error, eval);
                                        return error(buffer);
                                }
 
-                               if (tdb)
-                                       return error("non-absolute byte value");
-
                                D_byte(eval);
                        }
 
@@ -1374,10 +1395,98 @@ int d_68000(void)
        orgwarning = 0;
        SaveSection();
        SwitchSection(TEXT);
+       activecpu = CPU_68000;
+       return 0;
+}
+
+
+//
+// .68020 - Back to 68000 TEXT segment and select 68020
+//
+int d_68020(void)
+{
+       d_68000();
+       activecpu = CPU_68020;
+       return 0;
+}
+
+
+//
+// .68030 - Back to 68000 TEXT segment and select 68030
+//
+int d_68030(void)
+{
+       d_68000();
+       activecpu = CPU_68030;
+       return 0;
+}
+
+
+//
+// .68040 - Back to 68000 TEXT segment and select 68040
+//
+int d_68040(void)
+{
+       d_68000();
+       activecpu = CPU_68040;
+       activefpu = FPU_68040;
        return 0;
 }
 
 
+//
+// .68060 - Back to 68000 TEXT segment and select 68060
+//
+int d_68060(void)
+{
+       d_68000();
+       activecpu = CPU_68060;
+       activefpu = FPU_68040;
+       return 0;
+}
+
+
+//
+// .68881 - Back to 68000 TEXT segment and select 68881 FPU
+//
+int d_68881(void)
+{
+       d_68000();
+       activefpu = FPU_68881;
+       return 0;
+}
+
+
+//
+// .68882 - Back to 68000 TEXT segment and select 68882 FPU
+//
+int d_68882(void)
+{
+       d_68000();
+       activefpu = FPU_68881;
+       return 0;
+}
+
+
+//
+// nofpu - Deselect FPUs.
+//
+int d_nofpu(void)
+{
+       activefpu = FPU_NONE;
+       return 0;
+}
+
+
+//
+// DSP56001
+//
+int d_56001(void)
+{
+       return error("Not yet, child. Be patient.");
+}
+
+
 //
 // .gpu - Switch to GPU assembler
 //