×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

using mouse in assembly

using mouse in assembly

using mouse in assembly

(OP)
HI all,
i am a newbie in this forum..
i had a kinda of weird question...

i wanted to know how to get the mouse to work the way i want in assembly..

i have a program which asks to create a calculator that adds and subtracts, and be able to click on the buttons with the mouse..

i have the calculator drawn, and have kind of figured out how to enable the mouse and click, but how would i get the program to save the number and be able to do the arithmetic when the buttons are clicked??

the restrictions are that the user can enter up to 3 digit for each number, like 345 + 234....

how would i be able to make the program save the numbers and have it know that when i click 345, its saving it as 345 and not 3, 4, 5??

any help would be appreciated...

RE: using mouse in assembly

Use a variable.

"Information has a tendency to be free.  Which means someone will always tell you something you don't want to know."

RE: using mouse in assembly

Use a variable.

Do something like this:
displaynum=displaynum*10 + clickednum

when the user does a backspace:
displaynum=displaynum/10

"Information has a tendency to be free.  Which means someone will always tell you something you don't want to know."

RE: using mouse in assembly

Straiph

Assuming you are using DOS you can use the mouse action vector to execute a routine. This routine is supplied with the mouse X,Y and buttons pressed etc.

Using X,Y as a grid reference you can have as many buttons as you like and each executes a different routine.

You need to write a string value to binary convertion routine for when the user presses a function button (finished entering numbers) the number is stored as a binary value.

When a function like '+' is pressed the number should be stored into an array along with its terminating function. When the equals sign is pressed each value in the array is loaded and its terminating function will be performed with the next value and so on with the result displayed in the box. For this you need to write a convert binary to string value routine.

0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close