View difference between Paste ID: XszHNdcx and RaAbGh6G
SHOW: | | - or go back to the newest paste.
1
section .data
2
3
%macro full_line 1
4
    times %1 db "X"
5
    db 0x0a
6
%endmacro
7
8
%macro hollow_line 1
9
    db "X"
10
    times %1-2 db " "
11
    db "X", 0x0a
12
%endmacro
13
14
%macro box 2 ; width, height
15
    full_line %1
16
    %rep %2
17
        hollow_line %1
18
    %endrep
19
    full_line %1
20
%endmacro
21
22
board:
23
    box 80, 25
24
25
board_size  equ     $ - board
26
27
section .text
28
29
global main
30
31
main:
32
    mov rax, 0x2000004          ; syscall: SYS_write
33
    mov rdi, 1                  ; file descriptor: STDOUT_FILENO
34-
    mov rsi, board              ; buf (filler value)
34+
    mov rsi, board              ; buf
35
    mov rdx, board_size         ; nbytes
36
    syscall
37
38
    mov rax, 0x2000001          ; syscall: exit
39
    mov rdi, 0                  ; exit code
40
    syscall