I'd like to know if it's possible to get keystrokes in realtime using x86 assembly and if yes, how would that look. My goal is to make a program that continuously runs and executes some code only when the user presses a certain key, but doesn't stop until he does so. Until now I've only found solutions that either didn't work or stopped until the user pressed the key. I'm using x86 assembly with NASM as the assembler, my OS is Linux, I compile my code using these commands:
nasm -f elf64 hello_world.asm
ld -s -o hello_world hello_world.o
and a hello world example for me would look like this:
section .text
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int 0x80
mov eax,1
mov ebx,0
int 0x80
section .data
msg db 'Hello, world!', 0xa
len equ $ - msg
I've found a lot of people using int 16h
, but that's not possible on Linux.
Thanks in advance,
Konstantin