diff --git a/src/expr.c b/src/expr.c index 807cee4..d370803 100644 --- a/src/expr.c +++ b/src/expr.c @@ -197,7 +197,7 @@ void prcadr(int adract, char* symbol) { /* Parse and Compile Address of Operator * * Args: adract = Address Action */ void prsadr(int adract) { - DEBUG("Parsing address\n", 0) + DEBUG("expr.prsadr: Parsing address\n", 0) if (isnpre()) prsnum(0xFFFF); else { getwrd(); @@ -228,7 +228,7 @@ void prsstr(int adract, int alwstr) { * Args: adract = Address Action * * alwstr = Allow String */ int chkadr(int adract, int alwstr) { - DEBUG("Checking for Address or String\n", 0) + DEBUG("expr.chkadr: Checking for Address or String\n", 0) int result = TRUE; if (look('&')) prsadr(adract); else if (match('"')) prsstr(adract, alwstr); @@ -257,7 +257,9 @@ void prsbop(void) { /* Parse Function Argument or Return Values */ void prsfpr(char trmntr) { int pusha = 0; int pushy = 0; //A and Y Arguments Pushed - if (!chkadr(ADLDYX, TRUE) && isxpre() || match('.')) { + DEBUG("expr.prsfpr: Parsing Function Argument or Return Values\n", 0) + if (!chkadr(ADLDYX, TRUE) && !match(')')) { + DEBUG("expr.prsfpr: Parsing Accumulator Expression\n", 0); if (look('.')) pusha = 255; else {if (prsxpf(0)) goto prsfne;} if (look(',') && !chkadr(ADLDYX, TRUE)) { @@ -412,6 +414,7 @@ void prsxpr(char trmntr) { /* Parse and compile function parameter expression * * Returns: TRUE if Integer Expression */ int prsxpf(char trmntr) { + DEBUG("expr.prsxpf: Parsing Function Expression\n", 0) return prsxpp(trmntr, TRUE); } diff --git a/src/include.c b/src/include.c index 9e300db..0cd476c 100644 --- a/src/include.c +++ b/src/include.c @@ -177,7 +177,7 @@ void pincdr(void) { void phdwrd(void) { getwrd(); if (match(':')) prslab(); - else if (!ptype(MTNONE)) + else if (!pmodfr() && !ptype(MTNONE)) ERROR("Unexpected word '%s' in header\n", word, EXIT_FAILURE) } diff --git a/src/vars.c b/src/vars.c index b72812f..1090d3c 100644 --- a/src/vars.c +++ b/src/vars.c @@ -270,10 +270,12 @@ void addvar(int m, int t) { if (fndvar(vrname)) ERROR("Duplicate declaration of variable '%s\n", vrname, EXIT_FAILURE) if (t == VTVOID) ERROR("Illegal Variable Type\n", 0, EXIT_FAILURE) if (m & MTZP) { - setlbl(vrname); - sprintf(word, "$%hhX", zpaddr++); - if (t == VTINT) zpaddr++; //int uses two bytes - asmlin(EQUOP, word); + if (alcvar) { + setlbl(vrname); + sprintf(word, "$%hhX", zpaddr++); + if (t == VTINT) zpaddr++; //int uses two bytes + asmlin(EQUOP, word); + } strcpy(value, "*"); //Set Variable to Non Allocated } else if (m & MTALS) {