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 value : int; value : int; @nodisplay; @noframe;
Here are some example program dialogues to guide your efforts:
Provide a value:
Provide a value:
sameEndingDigit returned false!
Provide a value:
Provide a value:
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 value value;
bool result;
printf "Provide a value: ;
scanfd &value;
printf "Provide a value: ;
scanfd &value;
result sameEndingDigit value value;
if result
printf "sameEndingDigit returned true!
;
else
printf "sameEndingDigit returned false!
;
return;
bool sameEndingDigit int a int b
bool result false;
while a
a a ;
while b
b b ;
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
