System programmers do it with interrupts.