Skip to content

Commit 5e1badf

Browse files
committed
asm-6: Fix the register order
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
1 parent ac87a9f commit 5e1badf

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

content/asm_6.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ _read_first_float_vector:
328328
;; Set the length of the string we want to read from the standard input.
329329
mov rdx, BUFFER_SIZE
330330
;; Specify the system call number (0 is `sys_read`)
331-
mov rdi, SYS_READ
331+
mov rax, SYS_READ
332332
;; Set the first argument of `sys_read` to 0 (`stdin`)
333-
mov rax, STD_IN
333+
mov rdi, STD_IN
334334
;; Set the second argument of `sys_read` to the reference of the buffer where we will
335335
;; read the data for the vector.
336336
mov rsi, buffer_1

float/dot_product.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ _read_first_float_vector:
8383
;; Set the length of the string we want to read from the standard input.
8484
mov rdx, BUFFER_SIZE
8585
;; Specify the system call number (0 is `sys_read`)
86-
mov rdi, SYS_READ
86+
mov rax, SYS_READ
8787
;; Set the first argument of `sys_read` to 0 (`stdin`)
88-
mov rax, STD_IN
88+
mov rdi, STD_IN
8989
;; Set the second argument of `sys_read` to the reference of the buffer where we will
9090
;; read the data for the vector.
9191
mov rsi, buffer_1
@@ -160,9 +160,9 @@ _read_second_float_vector:
160160
;; Set the length of the string we want to read from the standard input.
161161
mov rdx, BUFFER_SIZE
162162
;; Specify the system call number (0 is `sys_read`).
163-
mov rdi, SYS_READ
163+
mov rax, SYS_READ
164164
;; Set the first argument of `sys_read` to 0 (`stdin`).
165-
mov rax, STD_IN
165+
mov rdi, STD_IN
166166
;; Set the second argument of `sys_read` to the reference of the buffer where we will
167167
;; read the data for the vector.
168168
mov rsi, buffer_2

0 commit comments

Comments
 (0)