mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GT-3534: Removed AF flag setting in add/sub flags when not being set
elsewhere
This commit is contained in:
parent
6de961364f
commit
222b42a76b
1 changed files with 2 additions and 4 deletions
|
@ -1229,12 +1229,11 @@ macro addCarryFlags ( op1, op2 ) {
|
||||||
local CFcopy = zext(CF);
|
local CFcopy = zext(CF);
|
||||||
CF = carry( op1, op2 );
|
CF = carry( op1, op2 );
|
||||||
OF = scarry( op1, op2 );
|
OF = scarry( op1, op2 );
|
||||||
local AFmask = -1 >> 4;
|
|
||||||
AF = (((op1 & AFmask) + (op2 & AFmask) + CFcopy) & (AFmask + 1)) != 0;
|
|
||||||
local result = op1 + op2;
|
local result = op1 + op2;
|
||||||
CF = CF || carry( result, CFcopy );
|
CF = CF || carry( result, CFcopy );
|
||||||
OF = OF ^^ scarry( result, CFcopy );
|
OF = OF ^^ scarry( result, CFcopy );
|
||||||
op1 = result + CFcopy;
|
op1 = result + CFcopy;
|
||||||
|
# AF not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1242,12 +1241,11 @@ macro subCarryFlags ( op1, op2 ) {
|
||||||
local CFcopy = zext(CF);
|
local CFcopy = zext(CF);
|
||||||
CF = op1 < op2;
|
CF = op1 < op2;
|
||||||
OF = sborrow( op1, op2 );
|
OF = sborrow( op1, op2 );
|
||||||
local AFmask = -1 >> 4;
|
|
||||||
AF = (((op1 & AFmask) - (op2 & AFmask) - CFcopy) & (AFmask + 1)) != 0;
|
|
||||||
local result = op1 - op2;
|
local result = op1 - op2;
|
||||||
CF = CF || (result < CFcopy);
|
CF = CF || (result < CFcopy);
|
||||||
OF = OF ^^ sborrow( result, CFcopy );
|
OF = OF ^^ sborrow( result, CFcopy );
|
||||||
op1 = result - CFcopy;
|
op1 = result - CFcopy;
|
||||||
|
# AF not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
macro resultflags(result) {
|
macro resultflags(result) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue