Re: CALUCLATOR!!!!!!
You will need a serial port on your micro, to be able to connect to a PC using Hyperterminal. That is the first thing.
Second, Hyperterminal uses ASCII characters. So you will need to take ASCII characters the user enters and store them in memory. Normally, the entry should end with = , just like in a calculator.
To provide the user feedback, you will need to echo each character as it is received. So once you receive a character, store it in memory, and then send it right back on the serial port. That will make it appear on the screen, giving the user feedback, so he knows things are operating. Nobody likes to type blindly.
Once you detect the = character, you know the user has finished the entry so you can now look at the characters he has entered. Check they are all valid characters, that is, numbers. If the user mistakenly entered another symbol ,such as a letter, send an error message and abort everything.
If all characters are OK, determine the type of operation you need to perform, by looking at the characters and identifying the +, -, etc. If none is fond, send an error.
If the operation is correct, check the size of the operators, to make sure you can handle those numbers. There are always limitations on how large or small the numbers can be, so check them and if they are not OK, send an error mesage.
If all checks OK, then do the operation you are required and then send the results.
Note that since everything is ASCII when it comes to Hyperterminal, you will need conversion routines to translate the numbers to their ASCII codes and the other way around.
Hope this helps.