/* Implement an ARM assembly subroutine that determines whether the absolute value
of the first parameter is greater than or equal to the absolute value of the second
parameter. If true, return 1; otherwise, return 0. Write a corresponding C++ program 4
to verify the correctness of the subroutine.
Function prototype: absolute_compare(int a, int b)*/
#include <stdio.h>
#include <stdlib.h>
extern "C"{
unsigned int absolute_compare(int x,int y);
}
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
signed int x,y;
printf("Enter the value of x:");
scanf("%d",&x);
printf("%d",x);
printf("\nEnter the value of y:");
scanf("%d",&y);
printf("%d",y);
printf("\n");
if(absolute_compare(x,y) == 1)
{
printf("Value of x is greater than or equal to y\n");
}
else
{
printf("Value of x is less than y\n");
}
}