#define DEF_KW
#include "kwtab.h"
+
TOKEN exprbuf[128]; // Expression buffer
SYM * symbolPtr[1000000]; // Symbol pointers table
static long unused; // For supressing 'write' warnings
//
-// dc.b, dc.w / dc, dc.l, dc.i
+// dc.b, dc.w / dc, dc.l, dc.i, dc.q, dc.d
//
int d_dc(WORD siz)
{
WORD eattr;
uint64_t eval;
- WORD tdb;
- WORD defined;
- uint64_t val64;
uint8_t * p;
if ((scattr & SBSS) != 0)
siz = SIZL;
}
- if (siz != SIZQ)
- {
// dc.x <expression>
SYM * esym = 0;
if (expr(exprbuf, &eval, &eattr, &esym) != OK)
return 0;
- }
- else
- {
- val64 = *(uint64_t *)(tok);
- tok = tok + 2;
- D_long((uint32_t)(val64 >> 32));
- D_long((uint32_t)val64);
- goto comma;
- }
-
- tdb = (WORD)(eattr & TDB);
- defined = (WORD)(eattr & DEFINED);
+ uint16_t tdb = eattr & TDB;
+ uint16_t defined = eattr & DEFINED;
if ((challoc - ch_size) < 4)
chcheck(4);
D_long(eval);
}
break;
+ case SIZQ:
+ // 64-bit size
+ if (m6502)
+ return error(in_6502mode);
+
+ // Shamus: We only handle DC.Q type stuff, will have to add fixups
+ // and stuff later (maybe... might not be needed...)
+ D_quad(eval);
+ break;
case SIZS:
if (m6502)
return error(in_6502mode);
D_single(eval);
}
+
break;
case SIZD:
if (m6502)
}
else
{
- double vv;
if (tdb)
MarkRelocatable(cursect, sloc, tdb, MDOUBLE, NULL);
- vv = *(double *)&eval;
+ double vv = *(double *)&eval;
D_double(vv);
}
+
break;
case SIZX:
if (m6502)
}
else
{
- float vv;
if (tdb)
MarkRelocatable(cursect, sloc, tdb, MEXTEND, NULL);
- vv = *(double *)&eval;
+ float vv = *(double *)&eval;
D_extend(vv);
}
+
break;
}
-
comma:
if (*tok != ',')
break;
// Get repeat count (defaults to 1)
if (*tok == '#')
{
- ++tok;
+ tok++;
if (abs_expr(&count) != OK)
return 0;
if (expr(exprbuf, &eval, &eattr, NULL) < 0)
return 0;
- switch ((int)*tok++)
+ switch (*tok++)
{ // Determine size of object to deposit
case DOTB: siz = SIZB; break;
case DOTW: siz = SIZB; break;
dep_block((uint32_t)count, siz, (uint32_t)eval, eattr, exprbuf);
- switch ((int)*tok)
+ switch (*tok)
{
case EOL:
return 0;
return ERROR;
}
- // If previous section was dsp or 68000 then we need to reset ORG'd Addresses
+ // If previous section was DSP or 68000 then we need to reset ORG'd Addresses
if (!rgpu)
{
-//printf("Resetting ORG...\n");
orgactive = 0;
orgwarning = 0;
}
-//else printf("NOT resetting ORG!\n");
rgpu = 1; // Set GPU assembly
rdsp = 0; // Unset DSP assembly