Actually, what I ended up doing was 1 djnz loop, with a _getkey call then a jump to an outer loop. In the inner loop, if 242 is reached, it jumps to the exit... Thanks Ahmed.