Подготовлено рабочее пространство

This commit is contained in:
Пытков Роман
2025-09-16 00:48:22 +03:00
parent c155f98534
commit 95e5aab32d
5 changed files with 107 additions and 11 deletions

12
.gitignore vendored
View File

@@ -1,11 +1 @@
CMakeLists.txt.user **/build/
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

30
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "<file>: lldb debug x64",
"program": "${fileDirname}/build/${fileBasenameNoExtension}",
"cwd": "${fileDirname}/build",
"preLaunchTask": "asm64"
},
{
"type": "lldb",
"request": "launch",
"name": "<file>: lldb+GCC debug x64",
"program": "${fileDirname}/build/${fileBasenameNoExtension}",
"cwd": "${fileDirname}/build",
"preLaunchTask": "asm64+gcc"
},
{
"type": "lldb",
"request": "launch",
"name": "minimal: lldb debug x64",
"program": "${workspaceFolder}/minimal/build/minimal",
"cwd": "${workspaceFolder}/minimal/build"
// TODO тут требуется ещё указать задачу сборки minimal, но её ещё нет
},
]
}

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"debug.allowBreakpointsEverywhere": true
}

57
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,57 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "asm64",
"type": "shell",
"command": [
"builddir=${fileDirname}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/${fileBasenameNoExtension};",
"nasm -F dwarf -g -f elf64 -i ${fileDirname} -o $rawfilename.o ${file};",
"ld -m elf_x86_64 -o $rawfilename $rawfilename.o;"
],
"problemMatcher": {
"pattern": {
"regexp": "error"
}
},
"presentation": {
"focus": true,
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "asm64+gcc",
"type": "shell",
"command": [
"builddir=${fileDirname}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/${fileBasenameNoExtension};",
"nasm -F dwarf -g -f elf64 -i ${fileDirname} -o $rawfilename.o ${file};",
"gcc -m64 -o $rawfilename $rawfilename.o;"
],
"problemMatcher": {
"pattern": {
"regexp": "error"
}
},
"presentation": {
"focus": true,
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
"group": {
"kind": "build"
}
}
]
}

16
minimal/minimal.asm Normal file
View File

@@ -0,0 +1,16 @@
global _start
section .data
text_message: db "Welcome to NASM!", 0xA
section .text
_start:
mov rax, 1 ; write
mov rdi, 1 ; stdout
mov rsi, text_message
mov rdx, 17 ; длина строки в байтах
syscall
mov rax, 60 ; exit
mov rdi, 1 ; код возврата = 0
syscall