Program which allows the user to select from menu, Assembly Language

Assignment Help:

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


Related Discussions:- Program which allows the user to select from menu

Assignment, 1. Write an assembly program that adds the elements in the odd ...

1. Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register? array1 DWORD 10, 20, 30, 40, 50, 6

Imul-arithmetic instruction-microprocessor, IMUL: Signed Multiplication: T...

IMUL: Signed Multiplication: This instruction multiplies a signed byte by a signed bit in source operand e in the register AL or signed word in source operand by signed word in th

LC-3 Program, Write an Lc-3 assembly language program to read in a sequence...

Write an Lc-3 assembly language program to read in a sequence of single-digit positive integers from the keyboard(one integer per line) until the sentinel value of 0 is reached and

Interrupt system based on 8259 a-microprocessor, Interrupt System Based on ...

Interrupt System Based on Single 8259 A The 8259A is contained in a 28-pin dual-in-line package that need only a + 5-V supply voltage.  Its organization is shown in given figur

PIC MCU, CAN U GIVE BRIEF THEORY

CAN U GIVE BRIEF THEORY

Code for reading flow & generating serial output, Assembly Code for Reading...

Assembly Code for Reading Flow & Generating Serial Output The timer is timer 1 is set for the baud rate 9600, as the crystal used is of 11.0592 Hz.  Then the timer 1 is starte

Xml, Write the structure of For…Next loop in VB.Net and also write a progra...

Write the structure of For…Next loop in VB.Net and also write a program to print integers from 1 to 10 on the console.

Cisc characteristics-microprocessor, CISC Characteristics : The design...

CISC Characteristics : The design of an instruction  set for a computer  might take into consideration  not only machine language constraints,  but  also  the  requirements  i

Assembly Language Programming, Write a program that defines symbolic consta...

Write a program that defines symbolic constants for all of the days of the week

Progframmw, write a programme the addition two 3*3 matrix and stored in fro...

write a programme the addition two 3*3 matrix and stored in from list

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd