#include "SDCCpeeph.h"
#include "gen.h"
-#define NOTUSEDERROR {fprintf (stderr, "SDCC internal error in notUsed() in %s, line %d\n", __FILE__, __LINE__);}
+#define NOTUSEDERROR() do {werror(E_INTERNAL_ERROR, __FILE__, __LINE__, "error in notUsed()");} while(0)
/*#define D(_s) { printf _s; fflush(stdout); }*/
#define D(_s)
// Find size of return value.
specifier *spec;
if(sym->type->select.d.dcl_type != FUNCTION)
- NOTUSEDERROR
+ NOTUSEDERROR();
spec = &(sym->etype->select.s);
if(spec->noun == V_VOID)
size = 0;
}
else
{
- NOTUSEDERROR
+ NOTUSEDERROR();
size = 4;
}
/* sanity check */
if (p == pl->line)
{
- NOTUSEDERROR
+ NOTUSEDERROR();
return NULL;
}
strncmp(pl->line, "sub\t", 4) == 0 ||
strncmp(pl->line, "xor\t", 4) == 0)
{
- if( strstr(pl->line + 3, what) == 0 && strcmp("a", what))
- return FALSE;
+ if( strstr(pl->line + 3, what) != 0)
+ return TRUE;
+ if( strstr(pl->line + 3, "hl") == 0 && strcmp("a", what) == 0)
+ return TRUE;
+ return FALSE;
}
if(strncmp(pl->line, "pop\t", 4) == 0)
strncmp(pl->line, "rl\t", 3) == 0 ||
strncmp(pl->line, "rr\t", 3) == 0 ||
strncmp(pl->line, "sla\t", 4) == 0 ||
+ strncmp(pl->line, "sra\t", 4) == 0 ||
strncmp(pl->line, "srl\t", 4) == 0)
{
return (strstr(pl->line + 3, what) != 0);
(bool)(strncmp(pl->line, "jr\t", 3)) == 0)
return FALSE;
+ if(strncmp(pl->line, "djnz\t", 5) == 0)
+ return(strchr(what, 'b') != 0);
+
if(strncmp(pl->line, "rla", 3) == 0 ||
strncmp(pl->line, "rlca", 4) == 0)
return(strcmp(what, "a") == 0);
static bool
z80CondJump(const lineNode *pl)
{
- if((strncmp(pl->line, "jp\t", 3) == 0 ||
- strncmp(pl->line, "jr\t", 3) == 0) && strchr(pl->line, ',') != 0)
+ if(((strncmp(pl->line, "jp\t", 3) == 0 ||
+ strncmp(pl->line, "jr\t", 3) == 0) && strchr(pl->line, ',') != 0) ||
+ strncmp(pl->line, "djnz\t", 5) == 0)
return TRUE;
return FALSE;
}