Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- %macro full_line 1
- times %1 db "X"
- db 0x0a
- %endmacro
- %macro hollow_line 1
- db "X"
- times %1-2 db " "
- db "X", 0x0a
- %endmacro
- %macro box 2 ; width, height
- full_line %1
- %rep %2
- hollow_line %1
- %endrep
- full_line %1
- %endmacro
- board:
- box 80, 25
- board_size equ $ - board
- section .text
- global main
- main:
- mov rax, 0x2000004 ; syscall: SYS_write
- mov rdi, 1 ; file descriptor: STDOUT_FILENO
- mov rsi, board ; buf
- mov rdx, board_size ; nbytes
- syscall
- mov rax, 0x2000001 ; syscall: exit
- mov rdi, 0 ; exit code
- syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement