Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Dec 27, 2023
1 parent 8c44467 commit 5c95842
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sample/no_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

struct Code : Xbyak::CodeGenerator {
Code(bool nf) {
if (nf) {
puts("no flags (with T_nf)");
} else {
puts("change flags (without T_nf)");
}
xor_(eax, eax); // CF = 0
mov(eax, -1);
if (nf) {
puts("no flags (with T_nf)");
add(eax|T_nf, eax, 1); // does not change CF
} else {
puts("change flags (without T_nf)");
add(eax, eax, 1); // CF = 1
}
adc(eax, 0); // eax = CF ? 1 : 0
Expand Down

0 comments on commit 5c95842

Please sign in to comment.