aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-20 23:33:10 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-23 00:34:38 +0100
commit9752e4e56b5a25110bb3c515cb94c7c57b901042 (patch)
treee1625462dd7c758ab98cf6389a3904de0969d48c
parent89d0a20d56f48ab967fd171aefefa729364c7484 (diff)
downloadnotes-9752e4e56b5a25110bb3c515cb94c7c57b901042.tar.gz
notes-9752e4e56b5a25110bb3c515cb94c7c57b901042.zip
x86: at&t for intel users
-rw-r--r--src/arch/x86_64.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/arch/x86_64.md b/src/arch/x86_64.md
index 38f40e1..ee5455e 100644
--- a/src/arch/x86_64.md
+++ b/src/arch/x86_64.md
@@ -148,6 +148,20 @@ mov cx, 0x10
rep stosb
```
+## AT&T syntax for intel syntax users
+```x86asm
+mov %rax, %rbx // mov rbx, rax
+mov $12, %rax // mov rax, 12
+
+mov (%rsp), %rax // mov rax, [rsp]
+mov 8(%rsp), %rax // mov rax, [rsp + 8]
+mov (%rsp,%rcx,4), %rax // mov rax, [rsp + 8 * rcx]
+mov 0x100, %rax // mov rax, [0x100]
+mov (0x100), %rax // mov rax, [0x100]
+
+mov %gs:8, %rax // mov rax, gs:8
+```
+
## Time stamp counter - `rdtsc`
```c
static inline uint64_t rdtsc() {