Fix function that updates N and Z flags of processor w/ S
This commit is contained in:
parent
c6574b72f8
commit
d6b551c190
@ -80,7 +80,9 @@ static void writeRegister(Machine *state, a64inst_regSpecifier reg, a64inst_regT
|
||||
|
||||
// Updates N and Z condition codes given the machine and a result value
|
||||
static void updateCondNZ(Machine *state, dword result, a64inst_regType regType) {
|
||||
state->conditionCodes.Negative = result & ((1 << (regType ? DWORD_BITS : WORD_BITS)) - 1);
|
||||
size_t msb = (regType ? DWORD_BITS : WORD_BITS) - 1;
|
||||
|
||||
state->conditionCodes.Negative = result >> msb;
|
||||
state->conditionCodes.Zero = result == 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user