Сложение двух чисел

This commit is contained in:
Пытков Роман
2025-09-22 00:53:15 +03:00
parent 6ef051900a
commit 444a2da5a8
7 changed files with 230 additions and 39 deletions

View File

@@ -30,7 +30,7 @@
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
},
]
}
]

View File

@@ -4,7 +4,7 @@ extern a
section .text
main:
push rbx ; сохранить rbx
push rbx
call scan ; прочитать первое число
mov rbx, rax ; сохранить первое число
call scan ; прочитать второе число
@@ -15,10 +15,9 @@ main:
push rax
call print ; напечатать
pop rax
pop rbx ; восстановить rbx
pop rbx
mov dword [rel a], eax ; записать значение 42 в переменную a
mov rdi, 0
mov rax, 60
syscall
mov rax, 0
ret

2
casm/input.txt Normal file
View File

@@ -0,0 +1,2 @@
10
20