Accept a number base value in another register determines


Introduction

For this assignment you will create a program that allows a user to select a number base (in the range of 2 to 16, inclusive), enter digits for the number base, validate each digit as it is entered, and display the resulting value in base 2, 8, 10 and 16.

Requirements

Create a program that:

Has six user-defined procedures (UDPs):
o IsLegal - this UDP shall:
Accept an ASCII value in one register.
Accept a number base value in another register.
Determines whether the ASCII value is valid for the base.
Use the AsciiToDigit procedure
Return 1 if the value is valid.
Return 0 if the value is not valid.

o AsciiToDigit - this UDP shall:
Accept an ASCII character value in a register.
Returns the numeric value related to the ASCII character value. For example, if ‘A' (41h) or ‘a' (61h) is passed in, then this procedure would return 10d.
Return -1 if the ASCII character is not valid.

o DigitToAscii - this UDP shall:
Accept a numeric value in a register.
Returns the ASCII character value related to the numeric value. For example, if 15d is passed in, then this procedure would return ‘F' or ‘f' (you must choose one case for letters).
Return -1 if the numeric value is not valid.

o WriteInteger - this UDP shall:
Accept a number in the EAX register.
Accept a number base value in the BL register.
Display the number in its base. For example, if 5 and 2 were passed in, this UDP would display 101.
Use the DigitToAscii procedure.
Not display leading zeroes.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Accept a number base value in another register determines
Reference No:- TGS01131152

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)