realemu: fix REP prefix condition
This commit is contained in:
parent
e63f13a8de
commit
da759a7fce
1 changed files with 3 additions and 3 deletions
|
@ -1067,7 +1067,7 @@ repcond(ulong *f, int rep)
|
|||
{
|
||||
if(rep == OREPNE)
|
||||
return (*f & ZF) == 0;
|
||||
return !rep || (*f & ZF) != 0;
|
||||
return (*f & ZF) != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1098,7 +1098,7 @@ opscas(Cpu *cpu, Inst *i)
|
|||
d->off += n;
|
||||
d->off &= m;
|
||||
c--;
|
||||
if(repcond(f, i->rep))
|
||||
if(!repcond(f, i->rep))
|
||||
break;
|
||||
}
|
||||
aw(areg(cpu, i->alen, RDI), d->off);
|
||||
|
@ -1135,7 +1135,7 @@ opcmps(Cpu *cpu, Inst *i)
|
|||
d->off += n;
|
||||
d->off &= m;
|
||||
c--;
|
||||
if(repcond(f, i->rep))
|
||||
if(!repcond(f, i->rep))
|
||||
break;
|
||||
}
|
||||
aw(areg(cpu, i->alen, RDI), d->off);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue