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...
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
"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
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
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!