diff --git a/minimal/.vscode/settings.json b/minimal/.vscode/settings.json deleted file mode 100644 index 9ddf6b2..0000000 --- a/minimal/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cmake.ignoreCMakeListsMissing": true -} \ No newline at end of file diff --git a/nasm.code-workspace b/nasm.code-workspace index 0e9177a..c39e75f 100644 --- a/nasm.code-workspace +++ b/nasm.code-workspace @@ -4,7 +4,7 @@ "path": "casm" }, { - "path": "minimal" + "path": "sum" }, { "path": "docs" @@ -15,4 +15,4 @@ "debug.inlineValues": "on", "editor.codeLens": false, } -} \ No newline at end of file +} diff --git a/minimal/.vscode/launch.json b/sum/.vscode/launch.json similarity index 66% rename from minimal/.vscode/launch.json rename to sum/.vscode/launch.json index cbf498a..a63e4ae 100644 --- a/minimal/.vscode/launch.json +++ b/sum/.vscode/launch.json @@ -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" } diff --git a/minimal/.vscode/tasks.json b/sum/.vscode/tasks.json similarity index 90% rename from minimal/.vscode/tasks.json rename to sum/.vscode/tasks.json index 645fd7a..c3d27ff 100644 --- a/minimal/.vscode/tasks.json +++ b/sum/.vscode/tasks.json @@ -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": { diff --git a/minimal/minimal.asm b/sum/sum.asm similarity index 98% rename from minimal/minimal.asm rename to sum/sum.asm index 63163f0..d36404b 100644 --- a/minimal/minimal.asm +++ b/sum/sum.asm @@ -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