]> Shamusworld >> Repos - rmac/commitdiff
Added in DSP fixups to sect.c, misc. fixes for 6502 assembler.
authorShamus Hammons <jlhamm@acm.org>
Tue, 6 Aug 2019 15:16:20 +0000 (10:16 -0500)
committerShamus Hammons <jlhamm@acm.org>
Tue, 6 Aug 2019 15:16:20 +0000 (10:16 -0500)
53 files changed:
6502.c
6502.h
68kgen.c
amode.c
amode.h
debug.c
debug.h
direct.c
direct.h
dsp56k.c
dsp56k.h
dsp56k_amode.c
dsp56k_amode.h
dsp56k_mach.c
dsp56k_mach.h
dsp56kgen.c
eagen.c
eagen.h
eagen0.c
error.c
error.h
expr.c
expr.h
fltpoint.c
fltpoint.h
kwgen.c
listing.c
listing.h
mach.c
mach.h
macro.c
macro.h
makefile
mark.c
mark.h
object.c
object.h
op.c
op.h
parmode.h
procln.c
procln.h
riscasm.c
riscasm.h
rmac.c
rmac.h
sect.c
sect.h
symbol.c
symbol.h
token.c
token.h
version.h

diff --git a/6502.c b/6502.c
index 55c604808283f56c12b5d45373300b70029e9cb1..27a8e1ac9ac41f153c882c95d1f65c1149931d81 100644 (file)
--- a/6502.c
+++ b/6502.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // 6502.C - 6502 Assembler
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -344,6 +344,7 @@ void m6502cg(int op)
                {
                        // (foo,x)
                        tok++;
+#if 0
                        p = string[tok[1]];
 
                        // Sleazo tolower() -----------------vvvvvvvvvvv
@@ -351,17 +352,27 @@ void m6502cg(int op)
                                goto badmode;
 
                        tok += 2;
-
                        if (*tok++ != ')')
                                goto badmode;
 
                        amode = A65_INDX;
+#else
+                       if (tok[0] == KW_X)
+                               amode = A65_INDX;
+
+                       if ((tok[1] != ')') || (tok[2] != EOL))
+                               goto badmode;
+
+                       tok += 2;
+#endif
                }
                else
                        goto badmode;
 
                break;
 
+       // I'm guessing that the form of this is @<expr>(X) or @<expr>(Y), which
+       // I've *never* seen before.  :-/
        case '@':
                tok++;
 
@@ -371,6 +382,7 @@ void m6502cg(int op)
                if (*tok == '(')
                {
                        tok++;
+#if 0
                        p = string[tok[1]];
 
                        if (*tok != SYMBOL || p[1] != EOS || tok[2] != ')' || tok[3] != EOL)
@@ -386,6 +398,19 @@ void m6502cg(int op)
                                goto badmode;
 
                        tok += 3;               // Past SYMBOL <string> ')' EOL
+#else
+                       if ((tok[1] != ')') || (tok[2] != EOL))
+                               goto badmode;
+
+                       if (tok[0] == KW_X)
+                               amode = A65_INDX;
+                       else if (tok[0] == KW_Y)
+                               amode = A65_INDY;
+                       else
+                               goto badmode;
+
+                       tok += 2;
+#endif
                        zpreq = 1;              // Request zeropage optimization
                }
                else if (*tok == EOL)
diff --git a/6502.h b/6502.h
index ccb2a57e00d9dc7901f710f5387553d8c88693a6..72f3ff673c2e3aa8d9a3891388bbdc8f84537270 100644 (file)
--- a/6502.h
+++ b/6502.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // 6502.H - 6502 assembler
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index ca3ce71b8f4c1ed16f043fd5a649d4abd1afecb5..497dbb49045a01b5a52539b31934056f28286ba6 100644 (file)
--- a/68kgen.c
+++ b/68kgen.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // 68KGEN.C - Tool to Generate 68000 Opcode Table
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/amode.c b/amode.c
index ccd86ddf184a95ace8385ea5da725277e0a15f19..8ac53920d1343d9dc6f3099274a46306c86ded6c 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-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/amode.h b/amode.h
index e46be37f09b6adc05e0c834ea0708fa5830487cc..5d9ff7222b2f9e7ebad9b49cf045c4f9d35f12f4 100644 (file)
--- a/amode.h
+++ b/amode.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // AMODE.H - Addressing Modes
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/debug.c b/debug.c
index 9ef0bcb2065c1ed1f5248a7ed0d9ba35f379d699..1b9b651515202ec2da47006af0a0d259fce563e2 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DEBUG.C - Debugging Messages
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/debug.h b/debug.h
index 71a6c7871c13783f4e6ae00eca18e15a13439efb..576b9580af3f1d6b8c56e2383d8c42fa185efaa6 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DEBUG.H - Debugging Messages
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 294ea4ac32649b19846bc8a69f5951c5ca522278..c42d8b8c727f5cd3e5ee938ccc6fc383f03c51a0 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DIRECT.C - Directive Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -280,7 +280,7 @@ int d_print(void)
 
        while (*tok != EOL)
        {
-               switch(*tok)
+               switch (*tok)
                {
                case STRING:
                        sprintf(prntstr, "%s", string[tok[1]]);
@@ -312,7 +312,7 @@ int d_print(void)
                        {
                                strcpy(prntstr, string[tok[2]]);
 
-                               switch(prntstr[0])
+                               switch (prntstr[0])
                                {
                                case 'l': case 'L': wordlong = 1; break;
                                case 'w': case 'W': wordlong = 0; break;
index dee418e15d7d9b7796e1ad5e1c104d17310e5520..55959b31017001c7077aa0ab43d40d3d4c8aaf81 100644 (file)
--- a/direct.h
+++ b/direct.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DIRECT.H - Directive Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 50e86017ff5392cff5ca896498c4a7de404e82cf..2960e2461492f2328df42a3a41666812b42dfc95 100644 (file)
--- a/dsp56k.c
+++ b/dsp56k.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DSP56K.C - General DSP56001 routines
-// Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index c73e99ebfb3b2400f9c25ae4060f340810eaa159..18395fc72f89a95353ef3432f8dd1de26cc6e95c 100644 (file)
--- a/dsp56k.h
+++ b/dsp56k.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // DSP56K.H - General DSP56001 routines
-// Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index c5644cce93b2de09d79cb3a74e07e9c015ff7437..6c8bc2597348cc32bc59ddfdc459bc34dafd5721 100644 (file)
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
 // AMODE.C - DSP 56001 Addressing Modes
-// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -753,7 +753,7 @@ int dsp_amode(int maxea)
         return ERROR;
 
 
-    // If caller wants only one mode, return just one (ignore comma); 
+    // If caller wants only one mode, return just one (ignore comma);
     // If there is no second addressing mode (no comma), then return just one anyway.
     nmodes = 1;
 
index 03ae9620d0450ee05a542b090580c72aa8b338ba..0582d49f2e29d0df7cd404357b8753642fa64438 100644 (file)
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
 // DSP56K_AMODE.H - Addressing Modes for Motorola DSP56001
-// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 20fc07af96eec0f16be143d74d5643c339ba3880..f7e8c870e7fc2906c330c9cc7543412b3e251e47 100644 (file)
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
 // DSP56L_MACH.C - Code Generation for Motorola DSP56001
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -75,7 +75,7 @@ static inline int dsp_extra_ea()
 {
        if (deposit_extra_ea == DEPOSIT_EXTRA_WORD)
        {
-               if (!(dspImmedEXATTR&FLOAT))
+               if (!(dspImmedEXATTR & FLOAT))
                {
                        if (dspImmedEXATTR & DEFINED)
                        {
index 593ff9a26159fc2e6c65f83e01712402acc83aef..184fc63015a783cb4102f134534227c482785cd0 100644 (file)
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
 // DSP56L_MACH.C - Code Generation for Motorola DSP56001
-// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 3f263ad7c4f83821c56aa8118e1ff6f1951ee3dc..06c666114f943afa582b2ab461ce5af86c59ebff 100644 (file)
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // 68KGEN.C - Tool to Generate 68000 Opcode Table
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/eagen.c b/eagen.c
index 5c83aad4a4646a0d089e7cd7f362737b353396ff..e416f233e5df4bb199453113daf7e75ed1b6d69b 100644 (file)
--- a/eagen.c
+++ b/eagen.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // EAGEN.C - Effective Address Code Generation
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/eagen.h b/eagen.h
index dcca6a642983a75a75cf9542babd60dd29dba97e..a130639066158526156435f38370e964326b94c1 100644 (file)
--- a/eagen.h
+++ b/eagen.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // EAGEN.H - Effective address generation for 68K
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 5b3c4ab5b35df2e34043b50364407d6bc5fe01c2..11e648afe845707f43b7638231acbca9d91e5e60 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-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/error.c b/error.c
index 9b5460b850e8f35846b6997e8f0a8f5bc82ebca6..6db7ad0f29c29d3d7261fafcd9f15dad2888222d 100644 (file)
--- a/error.c
+++ b/error.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // ERROR.C - Error Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/error.h b/error.h
index f4337286ad9789da5cb6eebdc2eec9eadb9dc2cd..be072d56cf3d3b604d7fdd110245197e51b07c5d 100644 (file)
--- a/error.h
+++ b/error.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // ERROR.H - Error Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/expr.c b/expr.c
index 6db7435dd205546e0afc4d25c3e018fcb1077301..d1ee1f55a1ffc824ecfaa540a91aa8b422baa17d 100644 (file)
--- a/expr.c
+++ b/expr.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // EXPR.C - Expression Analyzer
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/expr.h b/expr.h
index 517c4a04158f16c49622130a5bc335ba7c830f13..55ed1e669f5190ba9106d4f2391537baa62f7ef2 100644 (file)
--- a/expr.h
+++ b/expr.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // EXPR.H - Expression Analyzer
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 911e0085ae2729b6c513cf16f975061a86287adb..8739e88c1500d73397e6974df8c506377ee2e91a 100644 (file)
@@ -2,7 +2,7 @@
 // Floating point to IEEE-754 conversion routines
 //
 // by James Hammons
-// (C) 2018 Underground Software
+// (C) 2019 Underground Software
 //
 // Since there are no guarantees vis-a-vis floating point numbers in C, we have
 // to utilize routines like the following in order to guarantee that the thing
index 558ad7b5d24e378c01b607d486b5de3b62889d62..6444ed345d62644e96192cc53caf4e0379fed2d0 100644 (file)
@@ -2,7 +2,7 @@
 // Cross-platform floating point handling (fixed point handling too!)
 //
 // by James Hammons
-// (C) 2018 Underground Software
+// (C) 2019 Underground Software
 //
 
 #ifndef __FLTPOINT_H__
diff --git a/kwgen.c b/kwgen.c
index ae8e125c12081879e922191be2a094ef4a1e6716..b3c209ef2fe964ef4cea06ebe55caf9cf9b7634e 100644 (file)
--- a/kwgen.c
+++ b/kwgen.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // KWGEN.C - Keyword & Mnemonic Definition and State Machine Creation Tool
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index f6e7eb0d8180cb379378003e83a76fc3de7cde91..87956af889aba508e531149fc16b7dcce20ebce7 100644 (file)
--- a/listing.c
+++ b/listing.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // LISTING.C - Listing Output
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index d60793be9d3a8bdcb5205c5bc12fe528a0dfef80..c7a42ccddf7e132a82912d523524467451b6b8e2 100644 (file)
--- a/listing.h
+++ b/listing.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // LISTING.H - Listing Output
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/mach.c b/mach.c
index 9e124a9d79eb9f9af58ae70f0e3ca12bcbe04097..f979c9e98985d1eb8166c5011867271bed7f6c62 100644 (file)
--- a/mach.c
+++ b/mach.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MACH.C - Code Generation
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/mach.h b/mach.h
index e9b7c82c1bfccbd1670399d5a3e25b65356bfd15..5151210b9d3c6b934583a2e1dbaba24bc19d3c47 100644 (file)
--- a/mach.h
+++ b/mach.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MACH.H - Code Generation
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/macro.c b/macro.c
index 4ca149d19d2854620f75340cd18dd394a50ef194..8d5d88e9b4f0ffe9ad1d8fdadb270181810aa8eb 100644 (file)
--- a/macro.c
+++ b/macro.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MACRO.C - Macro Definition and Invocation
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/macro.h b/macro.h
index 49e387d4cecfd68759cbc0018745365478e83672..21807575983015584ff73ec8a722a256e19649c9 100644 (file)
--- a/macro.h
+++ b/macro.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MACRO.H - Macro Definition and Invocation
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index b69348fb22ec9225d983ce579e53f70265202669..ca6b7d1c99ba26f78f0492133b792f4f73370f2a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,6 +1,6 @@
 #
 # RMAC - Reboot's Macro Assembler for all Atari computers
-# Copyright (C) 199x Landon Dyer, 2011-2018 Reboot & Friends
+# Copyright (C) 199x Landon Dyer, 2011-2019 Reboot & Friends
 # MAKEFILE for *nix
 #
 
diff --git a/mark.c b/mark.c
index a5e1975498d33d3fd155267e957581d795b21907..1cb0f05131472f9d097dbdf5fe152ba58ef8c03e 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MARK.C - A record of things that are defined relative to any of the sections
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/mark.h b/mark.h
index 2415a80720783f779902314ea939b2eb46e08762..2d81f4dce7c81259af157898a29f9801b2818fce 100644 (file)
--- a/mark.h
+++ b/mark.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // MARK.H - A record of things that are defined relative to any of the sections
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 9f9de01b8071b0a984268d051e9e4d41b801065a..bee4fd60febb432fb79f91465a13b3e6fe6494af 100644 (file)
--- a/object.c
+++ b/object.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // OBJECT.C - Writing Object Files
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 4cac13b0ef901b362f15f9b9ad34fb33c11623ff..46aef64393359d809c765fc81fbf76d3a5d3746c 100644 (file)
--- a/object.h
+++ b/object.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // OBJECT.H - Writing Object Files
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/op.c b/op.c
index c73c72f8ec0ff489baa824fa79e6432de518d8c8..6a78fbc01f6898a7b5ab05e39b7fab4caf1c1c48 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2,7 +2,7 @@
 // Jaguar Object Processor assembler
 //
 // by James Hammons
-// (C) 2018 Underground Software
+// (C) 2019 Underground Software
 //
 
 #include "op.h"
diff --git a/op.h b/op.h
index f7c31b8ac553a355d8f62ab1ac5db13737264466..51bdc8dd578db5c45796489072be6895888f501e 100644 (file)
--- a/op.h
+++ b/op.h
@@ -2,7 +2,7 @@
 // Object Processor assembler
 //
 // by James Hammons
-// (C) 2018 Underground Software
+// (C) 2019 Underground Software
 //
 
 #ifndef __OP_H__
index 13b83fcae05cd27827f94b998d95361ccd89f93a..749d4e4daac169900d6aca5c4ff99dd72e561de7 100644 (file)
--- a/parmode.h
+++ b/parmode.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // PARMODE.C - Addressing Modes Parser Include
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 0bb52e6a733eafe35eb0c944b57048e074f45999..fe13aa760a822f649fd054805273c5ed3931cfc7 100644 (file)
--- a/procln.c
+++ b/procln.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // PROCLN.C - Line Processing
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index a8a1d95539091d3ba53c7411af787bb59b7287a0..07be91d393b6a473930f03ba79b0ea0bf3c7242d 100644 (file)
--- a/procln.h
+++ b/procln.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // PROCLN.H - Line Processing
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 0b09bf18ba3c641fa15189cf70cdd32d2c6d439b..fea5153a9f1bb54dd45aa6b52da55562b47621e7 100644 (file)
--- a/riscasm.c
+++ b/riscasm.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // RISCA.C - GPU/DSP Assembler
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index 91376dcdfc8640c22af21672c4431a8118213a48..b71c38e7bbc6b256a7ce79be4e6ad5d1d6984771 100644 (file)
--- a/riscasm.h
+++ b/riscasm.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // RISCA.H - GPU/DSP Assembler
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/rmac.c b/rmac.c
index 9dd75fdb86f8efabe6f92c990fd6a278c4e4c3da..ecc3adcdb51294eab38b80859044f2f68c117bed 100644 (file)
--- a/rmac.c
+++ b/rmac.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // RMAC.C - Main Application Code
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/rmac.h b/rmac.h
index cf8aabc2d9521c962205a70784c24b41fb68ca28..10e7e59aae29fc6bfddcbb0db31ceccaaaabc6f8 100644 (file)
--- a/rmac.h
+++ b/rmac.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // RMAC.H - Main Application Code
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/sect.c b/sect.c
index b076ca6a313dddaa9db58087ab1aac65f34b63fb..9c1a586b18dbd68d92bf3b06cf9edf72e2432776 100644 (file)
--- a/sect.c
+++ b/sect.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // SECT.C - Code Generation, Fixups and Section Management
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -262,6 +262,14 @@ int AddFixup(uint32_t attr, uint32_t loc, TOKEN * fexpr)
                exprlen = ExpressionLength(fexpr);
        }
 
+       // Second, check to see if it's a DSP56001 fixup, and force the FU_56001
+       // flag into the attributes if so; also save the current org address.
+       if (attr & FUMASKDSP)
+       {
+               attr |= FU_56001;
+               _orgaddr = orgaddr;
+       }
+
        // Allocate space for the fixup + any expression
        FIXUP * fixup = malloc(sizeof(FIXUP) + (sizeof(TOKEN) * exprlen));
 
@@ -330,7 +338,7 @@ int ResolveFixups(int sno)
                FIXUP * fup = fixup;
                fixup = fixup->next;
 
-               uint32_t w = fup->attr;         // Fixup long (type + modes + flags)
+               uint32_t dw = fup->attr;        // Fixup long (type + modes + flags)
                uint32_t loc = fup->loc;        // Location to fixup
                cfileno = fup->fileno;
                curlineno = fup->lineno;
@@ -376,7 +384,7 @@ int ResolveFixups(int sno)
                // Compute expression/symbol value and attributes
 
                // Complex expression
-               if (w & FU_EXPR)
+               if (dw & FU_EXPR)
                {
                        if (evexpr(fup->expr, &eval, &eattr, &esym) != OK)
                                continue;
@@ -418,7 +426,7 @@ int ResolveFixups(int sno)
                //
                // PC-relative fixups must be DEFINED and either in the same section
                // (whereupon the subtraction takes place) or ABS (with no subtract).
-               if (w & FU_PCREL)
+               if (dw & FU_PCREL)
                {
                        if (eattr & DEFINED)
                        {
@@ -454,7 +462,7 @@ int ResolveFixups(int sno)
                                        }
                                }
 
-                               if (sbra_flag && (w & FU_LBRA) && (eval + 0x80 < 0x100))
+                               if (sbra_flag && (dw & FU_LBRA) && (eval + 0x80 < 0x100))
                                        warn("unoptimized short branch");
                        }
                        else if (obj_format == MWC)
@@ -465,7 +473,7 @@ int ResolveFixups(int sno)
                }
 
                // Handle fixup classes
-               switch (w & FUMASK)
+               switch (dw & FUMASK)
                {
                // FU_BBRA fixes up a one-byte branch offset.
                case FU_BBRA:
@@ -518,10 +526,10 @@ int ResolveFixups(int sno)
                                continue;
                        }
 
-                       if ((w & FU_PCREL) && ((eval + 0x80) >= 0x100))
+                       if ((dw & FU_PCREL) && ((eval + 0x80) >= 0x100))
                                goto rangeErr;
 
-                       if (w & FU_SEXT)
+                       if (dw & FU_SEXT)
                        {
                                if ((eval + 0x100) >= 0x200)
                                        goto rangeErr;
@@ -554,16 +562,20 @@ int ResolveFixups(int sno)
                        break;
 
                // Fixup WORD forward references; the word could be unaligned in the
-               // section buffer, so we have to be careful.
+               // section buffer, so we have to be careful. (? careful about what?)
                case FU_WORD:
-                       if ((w & FUMASKRISC) == FU_JR)
+                       if ((dw & FUMASKRISC) == FU_JR)
                        {
+#if 0
                                int reg;
 
                                if (fup->orgaddr)
                                        reg = (signed)((eval - (fup->orgaddr + 2)) / 2);
                                else
                                        reg = (signed)((eval - (loc + 2)) / 2);
+#else
+                               int reg = (signed)((eval - ((fup->orgaddr ? fup->orgaddr : loc) + 2)) / 2);
+#endif
 
                                if ((reg < -16) || (reg > 15))
                                {
@@ -576,7 +588,7 @@ int ResolveFixups(int sno)
                                *locp |= ((uint8_t)reg & 0x07) << 5;
                                break;
                        }
-                       else if ((w & FUMASKRISC) == FU_NUM15)
+                       else if ((dw & FUMASKRISC) == FU_NUM15)
                        {
                                if (((int)eval < -16) || ((int)eval > 15))
                                {
@@ -589,7 +601,7 @@ int ResolveFixups(int sno)
                                *locp |= ((uint8_t)eval & 0x07) << 5;
                                break;
                        }
-                       else if ((w & FUMASKRISC) == FU_NUM31)
+                       else if ((dw & FUMASKRISC) == FU_NUM31)
                        {
                                if (eval > 31)
                                {
@@ -602,7 +614,7 @@ int ResolveFixups(int sno)
                                *locp |= ((uint8_t)eval & 0x07) << 5;
                                break;
                        }
-                       else if ((w & FUMASKRISC) == FU_NUM32)
+                       else if ((dw & FUMASKRISC) == FU_NUM32)
                        {
                                if ((eval < 1) || (eval > 32))
                                {
@@ -610,7 +622,7 @@ int ResolveFixups(int sno)
                                        break;
                                }
 
-                               if (w & FU_SUB32)
+                               if (dw & FU_SUB32)
                                        eval = (32 - eval);
 
                                eval = (eval == 32) ? 0 : eval;
@@ -619,7 +631,7 @@ int ResolveFixups(int sno)
                                *locp |= ((uint8_t)eval & 0x07) << 5;
                                break;
                        }
-                       else if ((w & FUMASKRISC) == FU_REGONE)
+                       else if ((dw & FUMASKRISC) == FU_REGONE)
                        {
                                if (eval > 31)
                                {
@@ -632,7 +644,7 @@ int ResolveFixups(int sno)
                                *locp |= ((uint8_t)eval & 0x07) << 5;
                                break;
                        }
-                       else if ((w & FUMASKRISC) == FU_REGTWO)
+                       else if ((dw & FUMASKRISC) == FU_REGTWO)
                        {
                                if (eval > 31)
                                {
@@ -649,7 +661,7 @@ int ResolveFixups(int sno)
                        {
                                flags = MWORD;
 
-                               if (w & FU_PCREL)
+                               if (dw & FU_PCREL)
                                        flags |= MPCREL;
 
                                MarkRelocatable(sno, loc, 0, flags, esym);
@@ -659,7 +671,7 @@ int ResolveFixups(int sno)
                                if (tdb)
                                        MarkRelocatable(sno, loc, tdb, MWORD, NULL);
 
-                               if (w & FU_SEXT)
+                               if (dw & FU_SEXT)
                                {
                                        if (eval + 0x10000 >= 0x20000)
                                                goto rangeErr;
@@ -667,7 +679,7 @@ int ResolveFixups(int sno)
                                else
                                {
                                        // Range-check BRA and DBRA
-                                       if (w & FU_ISBRA)
+                                       if (dw & FU_ISBRA)
                                        {
                                                if (eval + 0x8000 >= 0x10000)
                                                        goto rangeErr;
@@ -690,7 +702,7 @@ int ResolveFixups(int sno)
                case FU_LONG:
                        flags = MLONG;
 
-                       if ((w & FUMASKRISC) == FU_MOVEI)
+                       if ((dw & FUMASKRISC) == FU_MOVEI)
                        {
                                // Long constant in MOVEI # is word-swapped, so fix it here
                                eval = WORDSWAP32(eval);
@@ -709,17 +721,18 @@ int ResolveFixups(int sno)
 
                // Fixup QUAD forward references (mainly used by the OP assembler)
                case FU_QUAD:
-                       if (w & FU_OBJLINK)
+                       if (dw & FU_OBJLINK)
                        {
                                uint64_t quad = GETBE64(locp, 0);
                                uint64_t addr = eval;
 
+//Hmm, not sure how this can be set, since it's only set if it's a DSP56001 fixup or a FU_JR...  :-/
                                if (fup->orgaddr)
                                        addr = fup->orgaddr;
 
                                eval = (quad & 0xFFFFFC0000FFFFFFLL) | ((addr & 0x3FFFF8) << 21);
                        }
-                       else if (w & FU_OBJDATA)
+                       else if (dw & FU_OBJDATA)
                        {
                                // If it's in a TEXT or DATA section, be sure to mark for a
                                // fixup later
@@ -729,6 +742,7 @@ int ResolveFixups(int sno)
                                uint64_t quad = GETBE64(locp, 0);
                                uint64_t addr = eval;
 
+//Hmm, not sure how this can be set, since it's only set if it's a DSP56001 fixup or a FU_JR...  :-/
                                if (fup->orgaddr)
                                        addr = fup->orgaddr;
 
@@ -763,6 +777,131 @@ int ResolveFixups(int sno)
                        *locp = (uint8_t)eval;
                        break;
 
+               // Fixup DSP56001 addresses
+               case FU_56001:
+                       switch (dw & FUMASKDSP)
+                       {
+                       // DSPIMM5 actually is clamped from 0 to 23 for our purposes
+                       // and does not use the full 5 bit range.
+                       case FU_DSPIMM5:
+                               if (eval > 23)
+                               {
+                                       error("immediate value must be between 0 and 23");
+                                       break;
+                               }
+
+                               locp[2] |= eval;
+                               break;
+
+                       // This is a 12-bit address encoded into the lower 12
+                       // bits of a DSP word
+                       case FU_DSPADR12:
+                               if (eval >= 0x1000)
+                               {
+                                       error("address out of range ($000-$FFF)");
+                                       break;
+                               }
+
+                               locp[1] |= eval >> 8;
+                               locp[2] = eval & 0xFF;
+                               break;
+
+                       // This is a full DSP word containing Effective Address Extension
+                       case FU_DSPADR24:
+                       case FU_DSPIMM24:
+                               if (eval >= 0x100000)
+                               {
+                                       error("value out of range ($000-$FFFFFF)");
+                                       break;
+                               }
+
+                               *locp++ = (uint32_t)eval >> 16;
+                               *locp++ = ((uint32_t)eval >> 8) & 0xFF;
+                               *locp++ = (uint32_t)eval & 0xFF;
+                               break;
+
+                       // This is a 16bit absolute address into a 24bit field
+                       case FU_DSPADR16:
+                               if (eval >= 0x10000)
+                               {
+                                       error("address out of range ($0000-$FFFF)");
+                                       break;
+                               }
+
+                               locp[1] = (uint8_t)(eval >> 8);
+                               locp[2] = (uint8_t)eval;
+                               break;
+
+                       // This is 12-bit immediate short data
+                       // The upper nibble goes into the last byte's low nibble
+                       // while the remainder 8 bits go into the 2nd byte.
+                       case FU_DSPIMM12:
+                               if (eval >= 0x1000)
+                               {
+                                       error("immediate out of range ($000-$FFF)");
+                                       break;
+                               }
+
+                               locp[1] = (uint8_t)eval;
+                               locp[2] |= (uint8_t)(eval >> 8);
+                               break;
+
+                       // This is 8-bit immediate short data
+                       // which goes into the middle byte of a DSP word.
+                       case FU_DSPIMM8:
+                               if (eval >= 0x100)
+                               {
+                                       error("immediate out of range ($00-$FF)");
+                                       break;
+                               }
+
+                               locp[1] = (uint8_t)eval;
+                               break;
+
+                       // This is a 6 bit absoulte short address. It occupies
+                       // the low 6 bits of the middle byte of a DSP word.
+                       case FU_DSPADR06:
+                               if (eval > 63)
+                               {
+                                       error("address must be between 0 and 63");
+                                       break;
+                               }
+
+                               locp[1] |= eval;
+                               break;
+
+                       // This is a 6 bit absoulte short address. It occupies
+                       // the low 6 bits of the middle byte of a DSP word.
+                       case FU_DSPPP06:
+                               if (eval < 0xFFFFFFC0)
+                               {
+                                       error("address must be between $FFC0 and $FFFF");
+                                       break;
+                               }
+
+                               locp[1] |= eval & 0x3F;
+                               break;
+
+                       // Shamus: I'm pretty sure these don't make any sense...
+                       case FU_DSPIMMFL8:
+                               warn("FU_DSPIMMFL8 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+                               break;
+
+                       case FU_DSPIMMFL16:
+                               warn("FU_DSPIMMFL16 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+                               break;
+
+                       case FU_DSPIMMFL24:
+                               warn("FU_DSPIMMFL24 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+                               break;
+
+                       // Bad fixup type--this should *never* happen!
+                       default:
+                               interror(4);
+                               // NOTREACHED
+                       }
+                       break;
+
                // Fixup a 4-byte float
                case FU_FLOATSING:
                        warn("FU_FLOATSING missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
diff --git a/sect.h b/sect.h
index 83bc7b5a5736706cdbcd2f849e5e6b27ef1fbed3..84ad789c9456c931e14573cbff248b477c3ce136 100644 (file)
--- a/sect.h
+++ b/sect.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // SECT.H - Code Generation, Fixups and Section Management
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilized with the kind permission of Landon Dyer
 //
@@ -77,9 +77,8 @@
 #define FU_6BRA      0x0007            // Fixup 6502-format branch offset
 #define FU_BYTEH     0x0008            // Fixup 6502 high byte of immediate word
 #define FU_BYTEL     0x0009            // Fixup 6502 low byte of immediate word
-#define FU_QUAD      0x000A            // Fixup quad-word (8 bytes)
-#define FU_56001     0x000B            // Generic fixup code for all 56001 modes
-#define FU_56001_B   0x000C            // Generic fixup code for all 56001 modes (ggn: I have no shame)
+#define FU_QUAD      0x000A            // Fixup quad-word (8 bytes, typically OP)
+#define FU_56001     0x000B            // Fixup code for all 56001 modes
 
 #define FU_SEXT      0x0010            // Ok to sign extend
 #define FU_PCREL     0x0020            // Subtract PC first
 #define FU_OBJDATA   0x20000   // Fixup OL data addr (bits 43-63, drop last 3)
 
 // DSP56001 fixups
-// TODO: Sadly we don't have any spare bits left inside a 16-bit word
-// so we use the 2nd nibble as control code and
-// stick $B or $C in the lower nibble - then it's picked up as
-// FU_56001 by the fixup routine and then a second switch
-// selects fixup mode. Since we now have 32 bits, we can fix this!
-// [N.B.: This isn't true anymore, we now have 32 bits! :-P]
-#define FU_DSPIMM5    0x090B   // Fixup  5-bit immediate
-#define FU_DSPADR12   0x0A0B   // Fixup 12-bit address
-#define FU_DSPADR24   0x0B0B   // Fixup 24-bit address
-#define FU_DSPADR16   0x0C0B   // Fixup 24-bit address
-#define FU_DSPIMM12   0x0D0B   // Fixup 12-bit immediate
-#define FU_DSPIMM24   0x0E0B   // Fixup 24-bit immediate
-#define FU_DSPIMM8    0x0F0B   // Fixup  8-bit immediate
-#define FU_DSPADR06   0x090C   // Fixup  6-bit address
-#define FU_DSPPP06    0x0A0C   // Fixup  6 bit pp address
-#define FU_DSPIMMFL8  0x0B0C   // Fixup  8-bit immediate float
-#define FU_DSPIMMFL16 0x0C0C   // Fixup 16-bit immediate float
-#define FU_DSPIMMFL24 0x0D0C   // Fixup 24-bit immediate float
+#define FUMASKDSP     0xF00000 // Mask for DSP56001 fuckups^Wfixups
+#define FU_DSPIMM5    0x100000 // Fixup  5-bit immediate
+#define FU_DSPADR12   0x200000 // Fixup 12-bit address
+#define FU_DSPADR24   0x300000 // Fixup 24-bit address
+#define FU_DSPADR16   0x400000 // Fixup 16-bit address
+#define FU_DSPIMM12   0x500000 // Fixup 12-bit immediate
+#define FU_DSPIMM24   0x600000 // Fixup 24-bit immediate
+#define FU_DSPIMM8    0x700000 // Fixup  8-bit immediate
+#define FU_DSPADR06   0x800000 // Fixup  6-bit address
+#define FU_DSPPP06    0x900000 // Fixup  6 bit pp address
+#define FU_DSPIMMFL8  0xA00000 // Fixup  8-bit immediate float
+#define FU_DSPIMMFL16 0xB00000 // Fixup 16-bit immediate float
+#define FU_DSPIMMFL24 0xC00000 // Fixup 24-bit immediate float
 
 
 // Chunks are used to hold generated code and fixup records
index 87f90c048d80952a5a0cb18aec48035ae5905c36..84d5e16cc56beaa579067ecd7049aec4869ba827 100644 (file)
--- a/symbol.c
+++ b/symbol.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // SYMBOL.C - Symbol Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index f985b1bb23322b29873443a3b0ed79f34a88b2cc..47ea3cd3298e0c543d2f6d8ac9c4f790b9b04e20 100644 (file)
--- a/symbol.h
+++ b/symbol.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // SYMBOL.H - Symbol Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
diff --git a/token.c b/token.c
index 22bc64ac557dd73bc8c3957a330e1b78bc653663..564ff0cc895d9349644776c69021687927f7dd83 100644 (file)
--- a/token.c
+++ b/token.c
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // TOKEN.C - Token Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -560,7 +560,8 @@ DEBUG { printf("ExM: SYMBOL=\"%s\"", d); }
 //         to choke on legitimate code... Need to investigate this further
 //         before changing anything else here!
                                                        case CONST:
-                                                               sprintf(numbuf, "$%lx", (uint64_t)*tk++);
+//                                                             sprintf(numbuf, "$%lx", (uint64_t)*tk++);
+                                                               sprintf(numbuf, "$%" PRIX64, (uint64_t)*tk++);
                                                                tk++;
                                                                d = numbuf;
                                                                break;
diff --git a/token.h b/token.h
index 59e6ff50051ee7edf2aa4041029cb9e80d53e7cb..832301c1f8e493b8b6da1b6c0ffc75a9e4192176 100644 (file)
--- a/token.h
+++ b/token.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // TOKEN.H - Token Handling
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
index bd1b4d398f53d7eec3c1f5268bd8a26d6af5cb6c..1be65d89aa8c2ea77c1d2a2e7687be7b00de82a9 100644 (file)
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
 //
 // RMAC - Reboot's Macro Assembler for all Atari computers
 // VERSION.H - Version Information
-// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //