correcting subtraction

This commit is contained in:
Thiago Auler dos Santos 2017-11-22 19:47:01 -02:00
parent 258a9f6692
commit bac269c9c2
1 changed files with 6 additions and 3 deletions

View File

@ -308,21 +308,24 @@ void cmp()
{
// compare memory with accumulator
fetch_operand();
subtractor(ac, operand);
operand = operand ^ 0xFF;
adder(ac, operand);
}
void cpx()
{
// compare memory and index x
fetch_operand();
subtractor(x, operand);
operand = operand ^ 0xFF;
adder(x, operand);
}
void cpy()
{
// compare memory and index y
fetch_operand();
subtractor(y, operand);
operand = operand ^ 0xFF;
adder(y, operand);
}
void dec()