Files
solutions/04-addr-methods/task1.asm
root 4594912561 feat: решен первый пункт
Этот пункт действительно предполагает просто воспользоваться всеми типами адресации
2024-10-01 12:51:05 +03:00

34 lines
646 B
NASM
Raw Permalink 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.

global _start
section .data
%macro FILL_ASC 1
%assign NUM 0
%rep %1
db NUM
%assign NUM NUM + 1
%endrep
%endmacro
example: FILL_ASC 256
section .text
_start:
; В качестве базы возьму inc
; регистровая
inc ecx
mov rax, example
; косвенно-регистровая
inc byte [rax]
; "Индексно-базовая", хотя у меня почти все может быть базой
inc byte [rax + rbx]
; "Индексно-базовая" со смещением
inc byte [rax + rbx + 122]
; Ну в целом... все
mov rax, 60
mov rdi, 0
syscall