Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Write a program in Assembly that considers the following numbers: 541, 85, -12, 26 and outputs, for each of them, their decimal, binary

Part 1

Write a program in Assembly that considers the following numbers: 541, 85, -12, 26 and outputs, for each of them, their decimal, binary and hexadecimal form with following formatting:

541 00000000000000000000001000011101 0x0000021D

85 00000000000000000000000001010101 0x00000055

-12 11111111111111111111111111110100 0xFFFFFFF4

26 00000000000000000000000000011010 0x0000001A

That is, with a space between each representation for the same number, and with an empty line between each of the three numbers.

Part 2

Write a program in Assembly that, in a loop, reads a character C then outputs C-3, C and C+3 (basically the character together with its preceding and following ones by three). For each of them, you need to output their ASCII, decimal, hex and binary forms with formatting as in the following example. If C=I this is what your I/O window on MARS will display:

F 70 0x00000046 00000000000000000000000001000110

I 73 0x00000049 00000000000000000000000001001001

L 76 0x0000004C 00000000000000000000000001001100

Your program must repeat the acquisition & print in a loop as long as the following condition is met: the decimal value of the char user input must be within the range 36 to 123. If not, terminate the program. Basically, if you look at the ASCII table provided in class and on Blackboard, this means handling usual chars, representing numbers, letters, punctuation and common keyboard symbols.

Part 3

Write a program in Assembly that interacts with the user to perform age calculations. You will need to take from the user year, month and day and calculate with a certain precision (assuming Feb 1st 2017 now) the age then returns. Precision is: - For full credit, precision to the month; - For extra credit too, precision to the day as well (you must take into account leap years!!). Heres a sample of I/O to further clarify the exercise (user input is highlighted in bold font):

y?

1992

m?

10

1992.10 2017.2: 24 yr 3 mon

d?

25

You lived 8865 days.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago