Сложение двух чисел
This commit is contained in:
2
casm/.vscode/launch.json
vendored
2
casm/.vscode/launch.json
vendored
@@ -30,7 +30,7 @@
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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
2
casm/input.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
10
|
||||
20
|
||||
Reference in New Issue
Block a user