From 1953417c3ec3419b6d14b3ef0ead1759a33c756b Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 30 Jul 2021 00:58:53 -0400 Subject: Elaborate on test v cmp cmp instruction did not have an example. Signed-off-by: Malfurious --- docs/re/test_v_cmp.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'docs/re') diff --git a/docs/re/test_v_cmp.txt b/docs/re/test_v_cmp.txt index 5a0c5af..c98424f 100644 --- a/docs/re/test_v_cmp.txt +++ b/docs/re/test_v_cmp.txt @@ -7,8 +7,11 @@ themselves are zero. TEST also sets the sign flag (SF) when the most significant bit is set in the result, and the parity flag (PF) when the number of set bits is even. -JE (alias of JZ) tests the zero flag and jumps if it is set. This makes: +JE (alias of JZ) tests the zero flag and jumps if it is set. This creates the +following equivalencies: + test eax, eax -je 0x1234 -equivalent to the C statement: -if (eax == 0) +je ----> if (eax == 0) {} + +cmp eax, ebx +je ----> if (eax == ebx) {} -- cgit v1.2.3