aboutsummaryrefslogtreecommitdiffhomepage
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/no_flags.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/sample/no_flags.cpp b/sample/no_flags.cpp
index 8ab08df..52977b4 100644
--- a/sample/no_flags.cpp
+++ b/sample/no_flags.cpp
@@ -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