Please help
What's the problem?
It is listed in the attachment. Sorry for not specifying that.
I'm new here, where are the attachments?
I am new as well. Let me see if I can type it out.
Write an assembly program that reads in a large number of cents. The program will compute and display the number of dollar and cents desperately. Sample run ?324 3 24
Oh, sorry I can't help there
No worries
You haven't told what assembly... x86? The first thing you should do is write an algorithms and then focus on the code.
C++ is all we have been taught.
Then it sound a little hard to do with pure c++
Your kidding, right? It's not hard: int dollars = userInput / 100 int cents = userInput % 100 // or if assembly doesn't have the modulus operator cents = userInput - ( dollars * 100 ) If the processor doesn't do multiplication or division, multiplication is repetitive addition and division is repetitive subtraction.
Yes...the algorithm is really simple, doing in assembly without knowing assembly is a completely different thing.
In assembly you don't have variables per se. Reading from keyboard and printing numbers require more than one step. Converting the ascii thing from the keyboard to numbers to do operations like mod and division require more steps.
Join our real-time social learning platform and learn together with your friends!