Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6960385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:23:45+00:00 2026-05-27T15:23:45+00:00

I was playing around with assembly, compiling to .com files using NASM on Windows

  • 0

I was playing around with assembly, compiling to .com files using NASM on Windows 7. For some reason, this doesn’t work:

org 100h
run1:
mov ax, 3
int 33h
cmp bx, 0
je run1
xor bx, bx
run2:
mov ax, 3
int 33h
cmp bx, 0
je run2
int 20h

I think this should repeat run1 until there is a mouse click, and then do the same with run2. Then, the program should quit. But, when I execute the program, it only waits for one mouse click.
What do I need to do to fix this?
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:23:45+00:00Added an answer on May 27, 2026 at 3:23 pm

    I believe this will do it (with comments).
    (code is untested)

    Basically, there are now 3 loops.
    1.) Wait for the button to be pressed.
    2.) Wait for the button to be released.
    3.) Wait for the button to be pressed again.

    org 100h
    run1:
    mov ax, 3
    int 33h     #Check the mouse
    cmp bx, 0   #See if button is pressed
    je run1     #If Not pressed, go back and check again
    
    xor bx, bx  #Okay, button is pressed, clear the result
    
    run1a:
    mov ax, 3
    int 33h     #Check the mouse
    cmp bx, 0   #See if button is released
    jne run1a   #If NOT equal, then not released, go check again.
    
    xor bx, bx  #button is released, clear the result
    
    run2:
    mov ax, 3
    int 33h     #Check the mouse
    cmp bx, 0   #if button is pressed (2nd time)
    je run2     #If NOT pressed, go to top.
    
    int 20h     #Button was pressed.  All done (we don't care when its released)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a rather naive question. I'm just playing around with allocating some executable
While playing around with regexps in Scala I wrote something like this: scala> val
After playing around with haskell a bit I stumbled over this function: Prelude Data.Maclaurin>
I'm playing around with LinqToSQL using an existing multi-lingual database, but I'm running into
I'm playing around with WebMatrix and I'd just like to explore some of the
Just playing around with some of the APIs in .NET and I can't seem
Playing around with generating text randomly with each page refresh using php. Is there
Playing around with Google Maps these days, with some directions. I have a map
Playing around with jQuery a bit (sorry, complete noob) I was wondering why this
in playing around with the idea of using a webservice for my project I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.