-int HandleBitmap(void);
-int HandleScaledBitmap(void);
-int HandleGPUObject(void);
-int HandleBranch(void);
-int HandleStop(void);
-int HandleNOP(void);
-int HandleJump(void);
+static int HandleBitmap(void);
+static int HandleScaledBitmap(void);
+static int HandleGPUObject(void);
+static int HandleBranch(void);
+static int HandleStop(void);
+static int HandleNOP(void);
+static int HandleJump(void);
//static PTR fixupPtr = { .tk = (fixupExpr + 1) }; // C99 \o/
static PTR fixupPtr = { (uint8_t *)(fixupExpr + 1) }; // meh, it works
//static PTR fixupPtr = { .tk = (fixupExpr + 1) }; // C99 \o/
static PTR fixupPtr = { (uint8_t *)(fixupExpr + 1) }; // meh, it works
//
// The main Object Processor assembler. Basically just calls the sub functions
// to generate the appropriate code.
//
// The main Object Processor assembler. Basically just calls the sub functions
// to generate the appropriate code.
+ // It's OK to call this before validating state. If the state is invalid, an
+ // error will be generated and no object file will be produced, so it
+ // doesn't matter if the line number symbols are a little off.
+ GENLINENOSYM();
+
static inline void GetSymbolUCFromTokenStream(char * s)
{
strcpy(s, string[tok[1]]);
static inline void GetSymbolUCFromTokenStream(char * s)
{
strcpy(s, string[tok[1]]);
//
// Define a bitmap object
// Form: bitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>, <bpp>,
// <pallete idx>, <flags>, <firstpix>, <pitch>
//
//
// Define a bitmap object
// Form: bitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>, <bpp>,
// <pallete idx>, <flags>, <firstpix>, <pitch>
//
uint64_t p1 = 0x00 | ((ypos * 2) << 3) | (iheight << 14) | (linkAddr << 21) | (dataAddr << 40);
uint64_t p2 = xpos | (bpp << 12) | (pitch << 15) | (dwidth << 18) | (iwidth << 28) | (index << 38) | (flags << 45) | (firstpix << 49);
uint64_t p1 = 0x00 | ((ypos * 2) << 3) | (iheight << 14) | (linkAddr << 21) | (dataAddr << 40);
uint64_t p2 = xpos | (bpp << 12) | (pitch << 15) | (dwidth << 18) | (iwidth << 28) | (index << 38) | (flags << 45) | (firstpix << 49);
//
// Define a scaled bitmap object
// Form: scbitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>,
// <xscale>, <yscale>, <remainder>, <bpp>, <pallete idx>,
// <flags>, <firstpix>, <pitch>
//
//
// Define a scaled bitmap object
// Form: scbitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>,
// <xscale>, <yscale>, <remainder>, <bpp>, <pallete idx>,
// <flags>, <firstpix>, <pitch>
//
uint64_t p1 = 0x01 | ((ypos * 2) << 3) | (iheight << 14) | (linkAddr << 21) | (dataAddr << 40);
uint64_t p2 = xpos | (bpp << 12) | (pitch << 15) | (dwidth << 18) | (iwidth << 28) | (index << 38) | (flags << 45) | (firstpix << 49);
uint64_t p1 = 0x01 | ((ypos * 2) << 3) | (iheight << 14) | (linkAddr << 21) | (dataAddr << 40);
uint64_t p2 = xpos | (bpp << 12) | (pitch << 15) | (dwidth << 18) | (iwidth << 28) | (index << 38) | (flags << 45) | (firstpix << 49);
- if (expr(exprbuf, &eval, &eattr, &esym) != OK)
- return ERROR;
-
- if (!(eattr & DEFINED))
- return error("bad expression in y position");
-
- uint64_t ypos = eval;
-
- CHECK_COMMA;
-
if (expr(exprbuf, &eval, &eattr, &esym) != OK)
return ERROR;
if (!(eattr & DEFINED))
return error("bad expression in data");
if (expr(exprbuf, &eval, &eattr, &esym) != OK)
return ERROR;
if (!(eattr & DEFINED))
return error("bad expression in data");
//
// Insert a branch object
// Form: branch VC <condition (<, =, >)> <line #>, <link addr>
// branch OPFLAG, <link addr>
// branch SECHALF, <link addr>
//
//
// Insert a branch object
// Form: branch VC <condition (<, =, >)> <line #>, <link addr>
// branch OPFLAG, <link addr>
// branch SECHALF, <link addr>
//
{
uint64_t eval = (orgaddr + 8) & 0x3FFFF8;
// This is "branch if VC > 2047". Branch addr is next phrase, so either way
{
uint64_t eval = (orgaddr + 8) & 0x3FFFF8;
// This is "branch if VC > 2047". Branch addr is next phrase, so either way
// This is "branch if VC < 2047", which pretty much guarantees the branch.
uint64_t p1 = 0x03 | (1 << 14) | (0x7FF << 3) | ((eval & 0x3FFFF8) << 21);
// This is "branch if VC < 2047", which pretty much guarantees the branch.
uint64_t p1 = 0x03 | (1 << 14) | (0x7FF << 3) | ((eval & 0x3FFFF8) << 21);