29 lines
509 B
NASM
29 lines
509 B
NASM
format ELF64 executable 3
|
|
include "lib/linux_syscall.inc"
|
|
include "lib/print.inc"
|
|
include "lib/itoa.inc"
|
|
|
|
segment readable executable
|
|
entry main
|
|
|
|
main:
|
|
mov rax, 42069
|
|
mov rbx, part_1
|
|
call itoa
|
|
|
|
mov rdi, part_1_verbiage
|
|
call print_c_string
|
|
|
|
exit 0
|
|
|
|
segment readable writable
|
|
input_filename db '../data/2015/1/input.txt', 0, 'more text', 0
|
|
input_fd dq -1
|
|
input dq -1
|
|
part_1_verbiage db 'Part 1: '
|
|
part_1 db ' ', 0
|
|
part_2_verbiage db 'Part 2: ', 0
|
|
part_2 db ' ', 0
|
|
newline db 10
|
|
file_stat s_stat
|