Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Assembly Expert

Write a 32-bit program which when run, allows the user to select from a menu:

(1)    Enter a Binary Number

(2)    Enter a Decimal Number

(3)    Enter a Hexadecimal Number

(4)    Quit

Once the number has been entered, it should be converted into the other two formats and print all three formats in the output.

Requirements

1. The program must print a statement telling what the program is capable of doing. Do NOT repeat this statement.

2. Display a menu of choices and prompt the user for a selection.

3. Store the number entered by the user in a variable so that it may be retrieved and converted by the program to display the appropriate results.

4. Divide the program's tasks into manageable subroutines (Procedures).

5. All output should go to the screen using proper formatting techniques (spacing and blank lines as needed).

6. The program must accept up to 32 binary digits, eight hexadecimal digits, and integer numbers up to 4294967295.  This will require using the data type "dword" and 32 bit registers.

7. If the user enters invalid data (a number too big, not the correct type of number, etc), then the program must give an appropriate error message and then ask the user to enter a valid number.

8. If the user enters lower case alpha character (for the HEX numbers), convert them to uppercase before displaying the output.

9. The output should display all three forms of the number (see the sample run).  Any HEX number beginning with a letter must be preceded with a zero (0). Ex. 0A1B2

*This program only uses UNSIGNED integer arithmetic.  When we divide using DIV, we obtain only the whole number part of the answer in the EAX register...same with the multiplication (MUL).

This program allows any user to enter a binary, decimal, or hexadecimal number. The program will then take the given number and convert it into the other two formats and display the results on the screen.

1)       Enter a Binary Number

2)       Enter a Decimal Number

3)       Enter a Hexadecimal Number

4)       Quit

Enter your choice -->  1

Enter a binary number (less than 33 digits) -->  10101010

Binary = 10101010  Decimal = 170  Hexadecimal = 0AA

1)       Enter a Binary Number

2)       Enter a Decimal Number

3)       Enter a Hexadecimal Number

4)       Quit

Enter your choice -->  2

Enter a decimal number (less than 4294967295d) -->  215487963

Binary = 1100110110000001010111011011  Decimal = 215487963  Hexadecimal = 0CD815DB

1)       Enter a Binary Number

2)       Enter a Decimal Number

3)       Enter a Hexadecimal Number

4)       Quit

Enter your choice -->  3

Enter a hexadecimal number (less than 0FFFFFFFFh) -->  abcdefab

Binary = 10101011110011011110111110101011  Decimal = 2882400171  Hexadecimal = 0ABCDEFAB

1)       Enter a Binary Number

2)       Enter a Decimal Number

3)       Enter a Hexadecimal Number

4)       Quit

Enter your choice -->  5

Error: Invalid input.

Enter your choice -->  2

Enter a decimal number (less than 4294967295d) -->  99999999999999

Error: Input too large.  Try again please.

Enter your choice -->  4

Assembly, Programming

  • Category:- Assembly
  • Reference No.:- M9525412

Have any Question?


Related Questions in Assembly

Task 1using masm sdk write an assembly language program

TASK 1 Using MASM SDK, write an assembly language program which converts an integer inputted via the console to binary. Your program should be well commented and well formatted. TASK 2 Using MASM SDK, write an assembly l ...

Really need to find a correct answer to this questionwrite

Really need to find a correct answer to this question: Write a MIPS assembly program that can search for a number that is entered by a user in an array with 20 integer number. Make sure it also prints the index of the ar ...

Question a sequence string of one-byte ascii characters is

Question : A sequence (string) of one-byte ASCII characters is stored at memory location $600 onward. A second sequence of equal length is stored at memory location $700 onward. Each sequence ends with the character $0 ( ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As