Reading input from keyboard with x64 linux syscalls (assembly)
问题 I'm trying to learn how to use linux 64bits syscall in assembly. I was writing some code for reading keyboard and simply print it on screen the pressed keys: i'm using sys_read. The code: section .text global _start _start: ;write startmsg mov rax, 1 mov rdi, 1 mov rsi, startmsg mov rdx, sizestart syscall ;using sys_read mov ax, 0 mov rdi, 0 mov rsi, key mov rdx, 2 syscall ;trying to see if esc is pressed then exit mov rbx, 0x1b cmp rbx, key je _exit _exit: mov rax, 60 mov rdi, 0 syscall