Advertisement
jargon

TIMER.BAS

Oct 3rd, 2020
3,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 0.57 KB | None | 0 0
  1. ' Declare external MASM procedures.
  2. DECLARE SUB SetInt
  3. DECLARE SUB RestInt
  4.  
  5. ' Install new interrupt service routine.
  6. CALL SetInt
  7.  
  8. ' Set up the BASIC event handler.
  9. ON UEVENT GOSUB SpecialTask
  10. UEVENT ON
  11.  
  12. DO
  13. ' Normal program operation occurs here.
  14. ' Program ends when any key is pressed.
  15. LOOP UNTIL INKEY$ <> ""
  16.  
  17. ' Restore old interrupt service routine before quitting.
  18. CALL RestInt
  19.  
  20. END
  21.  
  22. ' Program branches here every 4.5 seconds.
  23. SpecialTask:
  24. ' Code for performing the special task goes here, for example:
  25. PRINT "Arrived here after 4.5 seconds."
  26. RETURN
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement