Files
NASM/stepik_base/macro/macro.asm
2025-09-23 17:48:53 +03:00

28 lines
505 B
NASM
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; Макрос для вывода сообщения
; 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