d_cstruct, // 53 .cstruct
d_jpad, // 54 .jpad (deprecated)
d_nojpad, // 55 .nojpad (deprecated)
+ d_gpumain, // 56 .gpumain (deprecated)
};
//
int d_print(void)
{
- char prntstr[LNSIZ]; // String for PRINT directive
- char format[LNSIZ]; // Format for PRINT directive
- int formatting = 0; // Formatting on/off
- int wordlong = 0; // WORD = 0, LONG = 1
- int outtype = 0; // 0:hex, 1:decimal, 2:unsigned
-
- VALUE eval; // Expression value
- WORD eattr; // Expression attributes
- SYM * esym; // External symbol involved in expr.
+ char prntstr[LNSIZ]; // String for PRINT directive
+ char format[LNSIZ]; // Format for PRINT directive
+ int formatting = 0; // Formatting on/off
+ int wordlong = 0; // WORD = 0, LONG = 1
+ int outtype = 0; // 0:hex, 1:decimal, 2:unsigned
+
+ VALUE eval; // Expression value
+ WORD eattr; // Expression attributes
+ SYM * esym; // External symbol involved in expr.
TOKEN r_expr[EXPRSIZE];
while (*tok != EOL)
}
printf("\n");
- println("\n");
+// println("\n");
return 0;
if (*tok != SYMBOL)
{
- error(syntax_error);
+// error(syntax_error);
+ error("syntax error; expected symbol");
return ERROR;
}
// Check that we are in a RISC section
if (!rgpu && !rdsp)
- {
- error(".equrundef/.regundef must be defined in .gpu/.dsp section");
- return ERROR;
- }
+ return error(".equrundef/.regundef must be defined in .gpu/.dsp section");
while (*tok != EOL)
{
// Check we are dealing with a symbol
if (*tok != SYMBOL)
- {
- error(syntax_error);
- return ERROR;
- }
+ return error("syntax error; expected symbol");
// Lookup and undef if equated register
-// regname = lookup((char *)tok[1], LABEL, 0);
regname = lookup(string[tok[1]], LABEL, 0);
if (regname && (regname->sattre & EQUATEDREG))
if (*tok != STRING)
{
- error(syntax_error);
+// error(syntax_error);
+ error("syntax error; string missing");
return ERROR;
}
{
if ((scattr & SBSS) == 0)
{
- savsect();
+ SaveSection();
chcheck(val);
for(i=0; i<val; i++)
//
int symlist(int(* func)())
{
- char * em = "symbol list syntax";
+ const char * em = "symbol list syntax";
for(;;)
{
if (*tok != SYMBOL)
return error(em);
-#if 0
- if ((*func)(tok[1]) != OK)
-#else
if ((*func)(string[tok[1]]) != OK)
-#endif
break;
tok += 2;
if (*tok != ',')
return error(em);
- ++tok;
+ tok++;
}
return 0;
//
int globl1(char * p)
{
- SYM *sy;
+ SYM * sy;
if (*p == '.')
return error("cannot .globl local symbol");
sy = NewSymbol(p, LABEL, 0);
sy->svalue = 0;
sy->sattr = GLOBAL;
+//printf("glob1: Making global symbol: attr=%04X, eattr=%08X, %s\n", sy->sattr, sy->sattre, sy->sname);
}
else
sy->sattr |= GLOBAL;
{
VALUE eval;
- savsect();
+ SaveSection();
if (*tok == EOL)
eval = 0;
else if (abs_expr(&eval) != OK)
return 0;
- switchsect(ABS);
+ SwitchSection(ABS);
sloc = eval;
return 0;
}
if (cursect != TEXT)
{
- savsect();
- switchsect(TEXT);
+ SaveSection();
+ SwitchSection(TEXT);
}
return 0;
if (cursect != DATA)
{
- savsect();
- switchsect(DATA);
+ SaveSection();
+ SwitchSection(DATA);
}
return 0;
if (cursect != BSS)
{
- savsect();
- switchsect(BSS);
+ SaveSection();
+ SwitchSection(BSS);
}
return 0;
case SIZB:
if (!defined)
{
- fixup(FU_BYTE | FU_SEXT, sloc, exprbuf);
+ AddFixup(FU_BYTE | FU_SEXT, sloc, exprbuf);
D_byte(0);
}
else
case SIZN:
if (!defined)
{
- fixup(FU_WORD | FU_SEXT, sloc, exprbuf);
+ AddFixup(FU_WORD | FU_SEXT, sloc, exprbuf);
D_word(0);
}
else
if (!defined)
{
if (movei)
- fixup(FU_LONG | FU_MOVEI, sloc, exprbuf);
+ AddFixup(FU_LONG | FU_MOVEI, sloc, exprbuf);
else
- fixup(FU_LONG, sloc, exprbuf);
+ AddFixup(FU_LONG, sloc, exprbuf);
D_long(0);
}
case SIZB:
if (!defined)
{
- fixup(FU_BYTE | FU_SEXT, sloc, exprbuf);
+ AddFixup(FU_BYTE | FU_SEXT, sloc, exprbuf);
D_byte(0);
}
else
case SIZN:
if (!defined)
{
- fixup(FU_WORD | FU_SEXT, sloc, exprbuf);
+ AddFixup(FU_WORD | FU_SEXT, sloc, exprbuf);
D_word(0);
}
else
case SIZL:
if (!defined)
{
- fixup(FU_LONG, sloc, exprbuf);
+ AddFixup(FU_LONG, sloc, exprbuf);
D_long(0);
}
else
// Switching from gpu/dsp sections should reset any ORG'd Address
orgactive = 0;
orgwarning = 0;
- savsect();
- switchsect(TEXT);
+ SaveSection();
+ SwitchSection(TEXT);
return 0;
}
// Put symbol in "order of definition" list
if (!(symbol->sattr & SDECLLIST))
- sym_decl(symbol);
+ AddToSymbolOrderList(symbol);
symbol->sattr |= (ABS | DEFINED | EQUATED);
symbol->svalue = eval;
// Put symbol in "order of definition" list
if (!(symbol->sattr & SDECLLIST))
- sym_decl(symbol);
+ AddToSymbolOrderList(symbol);
tok += 2;
return OK;
}
+
+int d_gpumain(void)
+{
+ return error("What the hell? Do you think we adhere to the Goof standard?");
+}
+