Перенос stepik в подпапку

This commit is contained in:
Пытков Роман
2025-09-23 17:48:53 +03:00
parent 6a90ff02c8
commit 184eeb8525
22 changed files with 282 additions and 35 deletions

29
stepik_base/macro/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch x64",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/macro",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "asm64",
},
{
"name": "(gdb) Launch x64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/macro",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "asm64"
},
{
"name": "(gdb+gcc) Launch x64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/macro",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "asm64+gcc"
}
]
}

53
stepik_base/macro/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,53 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "asm64",
"type": "shell",
"command": [
"builddir=${workspaceFolder}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/macro;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/macro.asm;",
"ld -g -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=${workspaceFolder}/build;",
"mkdir -p $builddir;",
"rawfilename=$builddir/macro;",
"nasm -gdwarf -f elf64 -o $rawfilename.o ${workspaceFolder}/macro.asm;",
"gcc -o $rawfilename $rawfilename.o;"
],
"problemMatcher": {
"pattern": {
"regexp": "error"
}
},
"presentation": {
"focus": true,
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
}
]
}

View File

@@ -0,0 +1,27 @@
; Макрос для вывода сообщения
; In:
; - %1 - указатель на буффер с сообщением
; - %2 - длина сообщения
%macro PRINT_MSG 2
mov rax, 1 ; sys_write
mov rdi, 1 ; stdout
mov rsi, %1
mov rdx, %2
syscall
%endmacro
global _start
section .data
g_msg db "Hello, Stepic!"
g_msg_len dq $-g_msg
section .text
default rel
_start:
PRINT_MSG g_msg, [g_msg_len]
mov rax, 60
mov rdi, 0
syscall