From: patrick_woflian on
Hey guys, i am need of desperate help.. i have been given the task of
using notepad to write a program in assembley language that converts a
number into either centigrade or fahrenheit.. i have most of the code
working, well the calculations anyway. However i do not know how to get
input from a user and to then use that number which is inputted, i have
looked online but cannot find any useful tutorials. Could anyone help?
Cheers,
Patrick

From: Betov on
"patrick_woflian" <gingercrock(a)hotmail.com> ?crivait
news:1142096414.186617.171020(a)j52g2000cwj.googlegroups.com:

> Hey guys, i am need of desperate help.. i have been given the task of
> using notepad to write a program in assembley language that converts a
> number into either centigrade or fahrenheit.. i have most of the code
> working, well the calculations anyway. However i do not know how to get
> input from a user and to then use that number which is inputted, i have
> looked online but cannot find any useful tutorials. Could anyone help?


Ah! DOS // A86... Well, the last time i used 86 for DOS
was more than 20 years ago. Annie will probably give you
better cues than me.

.... Now, you will probably get answers...

;)

Betov.

< http://rosasm.org >





From: santosh on
patrick_woflian wrote:
> Hey guys, i am need of desperate help.. i have been given the task of
> using notepad to write a program in assembley language that converts a
> number into either centigrade or fahrenheit.. i have most of the code
> working, well the calculations anyway. However i do not know how to get
> input from a user and to then use that number which is inputted, i have
> looked online but cannot find any useful tutorials. Could anyone help?
> Cheers,
> Patrick

One way is to use the DOS service 0Ah via INT 21h. For programming
under DOS, Ralf Brown's Interrupt List is invaluble. Get it from below.

http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html

You can also use RBILView, linked in the above URL, to view the list.

After getting the input, you'll have to check it's validity, (if
neccessary), and convert it to the numeric value. Converting strings to
numbers is quite easy, examples for doing it are found all over the
Internet.

From: patrick_woflian on
This is the code ive come up with so far:

JMP START
VarA DB 4
VarB DB 0
Temp1 DB ?
Temp2 DB ?


MESSAGE: DB "Please select C or F", CR,LF,"$"
NUMBER: DB "Please select number to be converted"
ANSWER: DB "Answer is $"


START:
MOV DX, MESSAGE

---- This will output the message to the user, but i just wondered how
to work on their answer? i know i will need an if statement, say if
user enters C then output message 'please enter number' and then that
number needs to be converted into Centigrade.. if F then output message
'please enter number' and then that number needs to be converted into
Fahenheit.. else output message 'failed'.

From: rhyde on

patrick_woflian wrote:
> Hey guys, i am need of desperate help.. i have been given the task of
> using notepad to write a program in assembley language that converts a
> number into either centigrade or fahrenheit.. i have most of the code
> working, well the calculations anyway. However i do not know how to get
> input from a user and to then use that number which is inputted, i have
> looked online but cannot find any useful tutorials. Could anyone help?
> Cheers,
> Patrick

Go to http://webster.cs.ucr.edu
Look up "The Art of Assembly Language Programming".
Lots of good examples can be found there (MASM or HLA).
Cheers,
Randy Hyde