Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 12-01-2011 05:12PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,157 ✭✭✭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