X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fpeep.c;h=ff72544bd6bf1d337f7ac256e693173a790ac2d3;hb=99bc0b93a68e12551d7c061a435715008835d50a;hp=7e27c07e52de6355648fc61d46d5b1f8efad36dd;hpb=a9fac239e06ffa5aebdf9590931b65cf5e0ca11a;p=fw%2Fsdcc diff --git a/src/z80/peep.c b/src/z80/peep.c index 7e27c07e..ff72544b 100644 --- a/src/z80/peep.c +++ b/src/z80/peep.c @@ -229,8 +229,11 @@ z80MightRead(const lineNode *pl, const char *what) 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) @@ -255,6 +258,9 @@ z80MightRead(const lineNode *pl, const char *what) (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); @@ -275,7 +281,8 @@ 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) + strncmp(pl->line, "jr\t", 3) == 0) && strchr(pl->line, ',') != 0 || + strncmp(pl->line, "djnz\t", 5) == 0) return TRUE; return FALSE; }