I am writing pong in assembly x86 with TASM and I have a problem.

The program is waiting to get input from the user to move the paddle (int 16h ah=0h) and while it is waiting the ball and the other paddle doesn't move.

What should I do?


1 Answer 1


Most of the keyboard interrupts that return data from the keyboard buffer (that is, most of the interrupt 16h family) block if there is not actually in the keyboard buffer.

What you need to do instead is first check if there's anything in the keyboard buffer. If there is, you can issue int 16h / AH = 0. Otherwise just continue with your regular game loop.

int 16h / AH = 1 can be used to check if there's anything in the buffer. It will set ZF to 0 if there's a key available for you to read.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .