fl/th.s

35 lines
342 B
ArmAsm
Raw Permalink Normal View History

2023-11-22 11:22:58 -08:00
bits 64
default rel
global cat
section .data
buf: db 0
section .text
cat:
push r12
push rbx
mov r12, rdi ; fd to read
mov rbx, rsi ; bytes to read
.l: mov eax, 3 ; read
mov rdi, r12
lea rsi, [buf]
mov rdx, 1
syscall
mov eax, 4 ; write
mov rdi, 1
lea rsi, [buf]
mov rdx, 1
syscall
dec rbx
jnz .l
pop rbx
pop r12
ret