Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

important things to check while monitoring system usage is / are

Answered: 1 week ago