From 0acd555410523eaadcb7393cc4ef77c42d27916c Mon Sep 17 00:00:00 2001 From: Dman95 Date: Tue, 7 Feb 2023 22:23:32 +0300 Subject: [PATCH] Fix Linux x64 examples --- BSD/share/sasm/Projects/FASMSumx64.asm | 12 ++++++------ BSD/share/sasm/Projects/GASSumx64.asm | 12 ++++++------ Linux/share/sasm/Projects/FASMSumx64.asm | 12 ++++++------ Linux/share/sasm/Projects/GASSumx64.asm | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/BSD/share/sasm/Projects/FASMSumx64.asm b/BSD/share/sasm/Projects/FASMSumx64.asm index 0b997fb..48fb69b 100644 --- a/BSD/share/sasm/Projects/FASMSumx64.asm +++ b/BSD/share/sasm/Projects/FASMSumx64.asm @@ -14,13 +14,13 @@ main: mov rbp, rsp; for correct debugging sub rsp, 32 and rsp, -16 - mov rcx, inputFormat - mov rdx, a - mov r8, b + mov rdi, inputFormat + mov rsi, a + mov rdx, b call scanf - mov rdx, qword[a] - add rdx, qword[b] - mov rcx, outputFormat + mov rsi, qword[a] + add rsi, qword[b] + mov rdi, outputFormat call printf mov rsp, rbp xor rax, rax diff --git a/BSD/share/sasm/Projects/GASSumx64.asm b/BSD/share/sasm/Projects/GASSumx64.asm index c5f22f0..d4007a0 100644 --- a/BSD/share/sasm/Projects/GASSumx64.asm +++ b/BSD/share/sasm/Projects/GASSumx64.asm @@ -12,13 +12,13 @@ main: movq %rsp, %rbp # for correct debugging subq $32, %rsp andq $-16, %rsp - movq $inputFormat, %rcx - movq $a, %rdx - movq $b, %r8 + movq $inputFormat, %rdi + movq $a, %rsi + movq $b, %rdx call scanf - movq (a), %rdx - addq (b), %rdx - movq $outputFormat, %rcx + movq (a), %rsi + addq (b), %rsi + movq $outputFormat, %rdi call printf movq %rbp, %rsp xorq %rax, %rax diff --git a/Linux/share/sasm/Projects/FASMSumx64.asm b/Linux/share/sasm/Projects/FASMSumx64.asm index 0b997fb..48fb69b 100644 --- a/Linux/share/sasm/Projects/FASMSumx64.asm +++ b/Linux/share/sasm/Projects/FASMSumx64.asm @@ -14,13 +14,13 @@ main: mov rbp, rsp; for correct debugging sub rsp, 32 and rsp, -16 - mov rcx, inputFormat - mov rdx, a - mov r8, b + mov rdi, inputFormat + mov rsi, a + mov rdx, b call scanf - mov rdx, qword[a] - add rdx, qword[b] - mov rcx, outputFormat + mov rsi, qword[a] + add rsi, qword[b] + mov rdi, outputFormat call printf mov rsp, rbp xor rax, rax diff --git a/Linux/share/sasm/Projects/GASSumx64.asm b/Linux/share/sasm/Projects/GASSumx64.asm index c5f22f0..d4007a0 100644 --- a/Linux/share/sasm/Projects/GASSumx64.asm +++ b/Linux/share/sasm/Projects/GASSumx64.asm @@ -12,13 +12,13 @@ main: movq %rsp, %rbp # for correct debugging subq $32, %rsp andq $-16, %rsp - movq $inputFormat, %rcx - movq $a, %rdx - movq $b, %r8 + movq $inputFormat, %rdi + movq $a, %rsi + movq $b, %rdx call scanf - movq (a), %rdx - addq (b), %rdx - movq $outputFormat, %rcx + movq (a), %rsi + addq (b), %rsi + movq $outputFormat, %rdi call printf movq %rbp, %rsp xorq %rax, %rax