/* Write an ARM assembly function that compares two signed integers and returns 1
if the first parameter is greater than or equal to the second parameter, and 0
otherwise. Provide a C++ program to test this function.
Function prototype: compare_integers(int a, int b) */
#include <stdio.h>
#include <stdlib.h>
extern "C"{
unsigned int compare_integers(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(compare_integers(x,y) == 1)
{
printf("Value of x is higher than or equal to y\n");
}
else
{
printf("Value of x is less than y\n");
}
}