minimal -> sum

This commit is contained in:
Пытков Роман
2025-09-22 00:58:48 +03:00
parent 444a2da5a8
commit 8d019a59d7
5 changed files with 15 additions and 17 deletions

View File

@@ -1,3 +0,0 @@
{
"cmake.ignoreCMakeListsMissing": true
}

View File

@@ -4,7 +4,7 @@
"path": "casm"
},
{
"path": "minimal"
"path": "sum"
},
{
"path": "docs"
@@ -15,4 +15,4 @@
"debug.inlineValues": "on",
"editor.codeLens": false,
}
}
}

View File

@@ -2,18 +2,18 @@
"version": "0.2.0",
"configurations": [
{
"name": "lldb x64",
"name": "(lldb) Launch x64",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/minimal",
"program": "${workspaceFolder}/build/sum",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "asm64",
},
{
"name": "cppdbg x64",
"name": "(gdb+gcc) Launch x64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/minimal",
"program": "${workspaceFolder}/build/sum",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "asm64+gcc"
}

View File

@@ -7,8 +7,8 @@
"command": [
"builddir=${workspaceFolder}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/minimal;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/minimal.asm;",
"rawfilename=$builddir/sum;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/sum.asm;",
"ld -g -o $rawfilename $rawfilename.o;"
],
"problemMatcher": {
@@ -33,8 +33,8 @@
"command": [
"builddir=${workspaceFolder}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/minimal;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/minimal.asm;",
"rawfilename=$builddir/sum;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/sum.asm;",
"gcc -o $rawfilename $rawfilename.o;"
],
"problemMatcher": {

View File

@@ -1,4 +1,4 @@
global main
global _start
section .data
buff times 256 db 0
@@ -8,7 +8,7 @@ count dq 0
section .text
default rel
main:
_start:
call read_text
lea rsi, [rel buff] ; поставить указатель на начало буфера
@@ -25,8 +25,9 @@ main:
mov rdx, [count]
call write_text
mov rax, 0
ret
mov rax, 60
mov rdi, 0
syscall
; Функция складывает два значения
; In: RDI, RSI