Skip to content

Commit

Permalink
Fix Linux x64 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Dman95 committed Feb 7, 2023
1 parent 44c3ceb commit 0acd555
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions BSD/share/sasm/Projects/FASMSumx64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions BSD/share/sasm/Projects/GASSumx64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Linux/share/sasm/Projects/FASMSumx64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Linux/share/sasm/Projects/GASSumx64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0acd555

Please sign in to comment.