From 0c452f6508a2e14b22aa3abc93497ee6078a49f8 Mon Sep 17 00:00:00 2001
From: Malfurious <m@lfurio.us>
Date: Sun, 20 Dec 2020 15:42:48 -0500
Subject: Create RE documentation directory

Signed-off-by: Malfurious <m@lfurio.us>
---
 docs/re/registers.txt                 | 18 ++++++++++++++++++
 docs/re/test_v_cmp.txt                | 14 ++++++++++++++
 docs/re/x86_instruction_reference.txt |  1 +
 3 files changed, 33 insertions(+)
 create mode 100644 docs/re/registers.txt
 create mode 100644 docs/re/test_v_cmp.txt
 create mode 100644 docs/re/x86_instruction_reference.txt

(limited to 'docs/re')

diff --git a/docs/re/registers.txt b/docs/re/registers.txt
new file mode 100644
index 0000000..c0a3fee
--- /dev/null
+++ b/docs/re/registers.txt
@@ -0,0 +1,18 @@
+Register sizes / mappings
+-------------------------
+
+The A register is used as an example
+
+ MSB                                                                   LSB
+ +--------+--------+--------+--------+--------+--------+--------+--------+
+ |                                  RAX                                  |
+ +--------+--------+--------+--------+--------+--------+--------+--------+
+                                     |                EAX                |
+                                     +--------+--------+--------+--------+
+                                                       |        AX       |
+                                                       +--------+--------+
+                                                       |   AH   |   AL   |
+                                                       +--------+--------+
+
+
+# TODO - calling conventions
diff --git a/docs/re/test_v_cmp.txt b/docs/re/test_v_cmp.txt
new file mode 100644
index 0000000..5a0c5af
--- /dev/null
+++ b/docs/re/test_v_cmp.txt
@@ -0,0 +1,14 @@
+CMP subtracts operands and sets internal flags.  Among these, it sets the
+zero flag if the difference is zero (operands are equal).
+
+TEST sets the zero flag (ZF) when the result of the AND operation is zero.  If
+the two operands are equal, their bitwise AND is zero only when the operands
+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:
+test eax, eax
+je 0x1234
+equivalent to the C statement:
+if (eax == 0)
diff --git a/docs/re/x86_instruction_reference.txt b/docs/re/x86_instruction_reference.txt
new file mode 100644
index 0000000..c90c64e
--- /dev/null
+++ b/docs/re/x86_instruction_reference.txt
@@ -0,0 +1 @@
+https://en.wikipedia.org/wiki/X86_instruction_listings
-- 
cgit v1.2.3