//
-// 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"
SYM * symbolPtr[1000000]; // Symbol pointers table
static long unused; // For supressing 'write' warnings
char buffer[256]; // Scratch buffer for messages
-int stringtype; // Non-zero if we need any special string conversions
// 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);
int d_cstruct(void);
int d_prgflags(void);
int d_opt(void);
+int d_dsp(void);
// Directive handler table
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
};
// 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
for(;; tok++)
{
// dc.b 'string' [,] ...
- if (siz == SIZB && *tok == STRING && (tok[2] == ',' || tok[2] == EOL))
+ if (siz == SIZB && (*tok == STRING || *tok == STRINGA8) && (tok[2] == ',' || tok[2] == EOL))
{
uint32_t i = strlen(string[tok[1]]);
if ((challoc - ch_size) < i)
chcheck(i);
- if (stringtype == NORMAL)
- {
- for (p = string[tok[1]]; *p != EOS; p++)
- D_byte(*p);
- }
- else if(stringtype == A8INT)
- {
- for (p = string[tok[1]]; *p != EOS; p++)
- D_byte(strtoa8[*p]);
- }
- else
- {
- error("String format not supported yet");
- }
-
+ if (*tok == STRING)
+ {
+ for(p=string[tok[1]]; *p!=EOS; p++)
+ D_byte(*p);
+ }
+ else if(*tok == STRINGA8)
+ {
+ for(p=string[tok[1]]; *p!=EOS; p++)
+ D_byte(strtoa8[*p]);
+ }
+ else
+ {
+ error("String format not supported... yet");
+ }
tok += 2;
goto comma;
}
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);
}
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
//