Anyone can send me this ("calculator.asm") as I described??

Started by concordex, March 20, 2005, 09:57:45 PM

Previous topic - Next topic

concordex

Write a program which will:

a) Ask for the operands to be used in the calculation

b) Ask for the operation type which will be applied to the operands

c) Write the operation including operands and operator

Sample Runs:

Enter the operands:
34
3
Enter the operation(+,-,x):
+
34+3=



Enter the operands:
105
27
Enter the operation(+,-,x):
x
105x27=



This week, at the end of the lab session, your program does not need to compute and display the result of the arithmetic operation. But in the second week, at the end of the lab, it should display the result, satisfying the specifications below:

The set of operations that the program is required to perform includes addition, subtraction, multiplication (shown by symbols +, - and x respectively)
Operands are positive integers of maximum 30 characters each, for addition and subtraction. For multiplication, the second operand has maximum three (3) digits.
All the entries for the operands will be nonnegative, however the result of a subtraction can be negative, in this case your program should display the result correctly.
Results should be printed left-justified without any leading zeros.
The multiplication must NOT be implemented using repeated addition (i.e 21x3=21+21+21). You should calculate the result in the way that you do multiplication by hand:


    321   

        _x__125_____

        1605       

        642

      321

_+___________

      40125     



*The above figure is just for an illustration of how the multiplicaton is done, the output will not look like this.



HINT: Using  the instructions AAD, AAS and AAM may make your work a lot easier.


BogdanOntanu

Nobody told you that you should do your homework alone or else you might not learn nothing ?
:green2

You are very close to the line here...
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

mnemonic

Hey man, let's get a bit more serious in here.
You ain't really thinking that someone in here will ever do the homework for you, are you? But if you do so you should point out a VERY good reason.

Quote from: concordex on March 20, 2005, 09:57:45 PM
This week, at the end of the lab session, your program does not need to compute and display the result of the arithmetic operation. But in the second week, at the end of the lab, it should display the result, satisfying the specifications below:

As you wrote yourself: You've got a week to code the input part of your program.
Grab the assembler your teacher told you to use, grab your handouts from class, grab your favourite text editor and get it on.
That's not much work to be done and I'm sure that you can solve it yourself.

If you've got a certain problem come back and ask for help.

What kind of program should it be, btw (Win32-exe, DOS-exe, Linux binary)?
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

Tedd

No snowflake in an avalanche feels responsible.

P1

Welcome concordex   :U 

Glad to have you here!

You will find some the best people in the world, come here to get answers, as well as give them.

If you like getting and giving help in Assembler, this is the place for you!!      :clap:

Look forward to you participating with us.      :thumbu

The first thing you learn here is to help yourself as far as you can go.  Then ask for help on what your having problems on.  Newbies must learn that googoo = google for finding solutions that are traditional or standard.

Homework is to help you LEARN.    I see no code, where you at least tried to complete the assignment.   The "HINT:" at the bottom, was insulting to say the least.  Because if you can hint to us, that must mean, you can code for yourself.  "may make your work a lot easier.", go make YOUR work easier for yourself.  Stop wasting your time on waiting for us to do it.

We have all earned our experience by not skipping the basics.

Regards,  P1  :8)