From e858bb74b3ffd22ba44bd7bcaf240902ca257316 Mon Sep 17 00:00:00 2001 From: 0x3bb <0x3bb@3bb.io> Date: Thu, 8 Aug 2024 01:13:21 +0000 Subject: [PATCH] Update 2024-07-27-sys-write-string.md --- 2024-07-27-sys-write-string.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024-07-27-sys-write-string.md b/2024-07-27-sys-write-string.md index 2304fbb..0fe08e4 100644 --- a/2024-07-27-sys-write-string.md +++ b/2024-07-27-sys-write-string.md @@ -12,7 +12,7 @@ An approachable way for beginners to understand how syscalls are made in Linux i Looking at that table, it can be concluded the following registers need to be populated: -- `rdi` → the call identifier. for `sys_write`, it's `1` from reading the first column of that table +- `rax` → the call identifier. for `sys_write`, it's `1` from reading the first column of that table - `rdi` → file descriptor, `1` being for `stdout` - `rsi` → contents of buffer (i.e. the string) - `rdx` → length of the buffer for stdout @@ -23,7 +23,7 @@ The first step is to define the `.data` section and initialize memory for `rsi`. The syntax looks like this: -`0xa` is just the ASCII hex representation of a new line. +`0x0a` is just the ASCII hex representation of a new line. ``` ; sys_write_string.asm