Closed Ankeraout closed 4 years ago
Could you provide an assembly example for this? I have no idea how a tst
could act as ands
because they are using different opcodes to begin with.
In my source code, I made this mistake:
DECLARE_DATAPROC_OPCODE(
tst,
uint32_t result = Rn_v & op2;
logicSetFlags(result);
registerWrite(Rd, result); // Here is the problem.
S_FOOTER;
)
In this case, the test fails because TST, like CMP, CMN and TEQ, is not supposed to change the value of Rd. The test shows a red screen.
Removing registerWrite(Rd, result);
from the code fixed the problem.
Here is the source code of the test.
Glad you figured it out. I am not going to add extra tests for this because I consider it default hehavior.
gba-suite does not detect when
tst r0, r1
actually acts asands r0, r0, r1
. The same thing happened for TEQ. I did not test for CMP and CMN.