summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-12-20 02:52:55 -0500
committerdusoleil <howcansocksbereal@gmail.com>2021-12-20 02:52:55 -0500
commit559520f56a2074f4daa3d6abf00a356f4ec6a144 (patch)
tree12d2e801c61d1bfd1049d1a3fb02f7625b2d77ee
parent80ca0c81400b47d3e13c089e4afd1dbf4e9ad9d3 (diff)
downloadlib-des-gnux-559520f56a2074f4daa3d6abf00a356f4ec6a144.tar.gz
lib-des-gnux-559520f56a2074f4daa3d6abf00a356f4ec6a144.zip
Add doc about the rep prefix on an x86 instruction
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--docs/re/rep_prefix.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/re/rep_prefix.txt b/docs/re/rep_prefix.txt
new file mode 100644
index 0000000..b1206cc
--- /dev/null
+++ b/docs/re/rep_prefix.txt
@@ -0,0 +1,18 @@
+The "rep" prefix on a string instruction repeats that string instruction for CX block loads.
+e.g.
+STOS is "Store String"
+It will store the value in AX at the address in RDI
+(technically, STOSB, STOSW, STOD, and STOSQ use AL, AX, EAX, and RAX respectively)
+If RCX = 0x20, RDI = some buffer, and RAX = 0,
+
+`rep stosq`
+
+is equivalent to:
+
+```
+buf_ptr = buf
+for(i = 0x20; i != 0; i++)
+ *buf_ptr = 0;
+ buf_ptr++;
+```
+