Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Assembly 8086: Check if a key is pressed to exit a program

Options
  • 12-01-2011 5:12pm
    #1
    Registered Users Posts: 9,249 ✭✭✭


    Hi all.

    This is one problem that has literally plagued me and i can't see to get a answer for it.

    In my program i wish to do a simple loop function.

    Draw a box that incerements and decrements up and down the screen.

    However when a button is pressed i want the program to exit.

    My problem is that i don't want the program to hang when i use INT21 Check Keyboard status as the loop won't continue the interrupt requires input to exit.

    How do i get past this? I need to be constantly checking if their is input but do not wish my initial action loop to stop as a result of it.

    Any help would be great.


Comments

  • Registered Users Posts: 2,150 ✭✭✭dazberry


    Check out Int 16h, AFAIR you can poll the keyboard state to see if a character is there...

    mov ah,01
    int 16h
    jz ...

    D.


Advertisement