Question: Create an HLA Assembly language program that prompts for two integers from the user. Create and call a function that accepts these two values and

Create an HLA Assembly language program that prompts for two integers from the user. Create and call a function that accepts these two values and then determines if these values both have the same ending digit. Sets DX to one if the values both have the same ending digit; otherwise, set DX to zero. In order to receive full credit, after returning back to the caller, your function should not change the value of any register other than DX. Implement the function whose signature is:
procedure sameEndingDigit( value1 : int8; value2 : int8); @nodisplay; @noframe;
Here are some example program dialogues to guide your efforts:
Provide a value: 333
Provide a value: 18
sameEndingDigit returned false!
Provide a value: 88
Provide a value: 338
sameEndingDigit returned true!
In an effort to help you focus on building an Assembly program, Id like to offer you the following C statements which match the program specifications stated above. If you like, use them as the basis for building your Assembly program.
SAMPLE C CODE:
------------------------
bool sameEndingDigit( int a, int b );
int main()
{
int value1, value2;
bool result;
printf( "Provide a value: ");
scanf("%d", &value1);
printf( "Provide a value: ");
scanf("%d", &value2);
result = sameEndingDigit( value1, value2);
if (result)
printf( "sameEndingDigit returned true!
");
else
printf( "sameEndingDigit returned false!
");
return(0);
}
bool sameEndingDigit( int a, int b )
{
bool result = false;
while (a >=10)
a = a -10;
while (b >=10)
b = b -10;
if (a == b)
result = true;
return( result );
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!