]> Shamusworld >> Repos - rmac/blobdiff - riscasm.c
Actually implement ^^FILESIZE this time :)
[rmac] / riscasm.c
index d595ebc96257f275a907febb33e63b9cebcf81d5..82caf808d463e07d6b4cbbce9ce7076c2b6d7ae7 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-2020 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
 // Source utilised with the kind permission of Landon Dyer
 //
@@ -13,6 +13,7 @@
 #include "expr.h"
 #include "mark.h"
 #include "procln.h"
+#include "rmac.h"
 #include "sect.h"
 #include "token.h"
 
@@ -134,16 +135,6 @@ static const char * malformErr[] = {
 };
 
 
-//
-// Convert a string to uppercase
-//
-static void strtoupper(char * s)
-{
-       while (*s)
-               *s++ &= 0xDF;
-}
-
-
 //
 // Function to return "malformed expression" error
 // This is done mainly to remove a bunch of GOTO statements in the parser
@@ -267,7 +258,7 @@ int GenerateRISCCode(int state)
        // UNPACK
        case RI_ONE:
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, parm >> 6, reg2);
                break;
 
@@ -285,7 +276,7 @@ int GenerateRISCCode(int state)
                        altbankok = 1;                      // MOVETA
 
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg1, reg2);
                break;
 
@@ -347,7 +338,7 @@ int GenerateRISCCode(int state)
 
                CHECK_COMMA;
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg1, reg2);
                break;
 
@@ -396,7 +387,7 @@ int GenerateRISCCode(int state)
 
                CHECK_COMMA;
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
 
                DepositRISCInstructionWord(parm, 0, reg2);
                val = WORDSWAP32(eval);
@@ -419,7 +410,7 @@ int GenerateRISCCode(int state)
 
                CHECK_COMMA;
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg1, reg2);
                break;
 
@@ -542,7 +533,7 @@ int GenerateRISCCode(int state)
                tok++;
                CHECK_COMMA;
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg1, reg2);
                break;
 
@@ -661,7 +652,7 @@ int GenerateRISCCode(int state)
                        return MalformedOpcode(MALF_RPAREN);
 
                tok++;
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg2, reg1);
                break;
 
@@ -679,7 +670,7 @@ int GenerateRISCCode(int state)
                tok++;
                CHECK_COMMA;
                reg2 = EvaluateRegisterFromTokenStream(FU_REGTWO);
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg1, reg2);
                break;
 
@@ -698,7 +689,7 @@ int GenerateRISCCode(int state)
                        return MalformedOpcode(MALF_RPAREN);
 
                tok++;
-               at_eol();
+               ErrorIfNotAtEOL();
                DepositRISCInstructionWord(parm, reg2, reg1);
                break;
 
@@ -811,7 +802,7 @@ int GenerateRISCCode(int state)
                                return MalformedOpcode(MALF_RPAREN);
 
                        tok++;
-                       at_eol();
+                       ErrorIfNotAtEOL();
                }
 
                DepositRISCInstructionWord(parm, reg2, reg1);