/* Create an ARM assembly subroutine that accepts two signed integers as parameters
and determines whether the product of the two integers is greater than or equal to
zero. If true, return 1; otherwise, return 0. Provide a C++ program for testing.
Function prototype: product_comparison(int a, int b)*/
#include <stdio.h>
#include <stdlib.h>
extern "C"{
unsigned int product_comparison(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(product_comparison(x,y) == 1)
{
printf("The product between two signed integers is greater than or equal to zero\n");
}
else
{
printf("The product between two signed integers is less than zero\n");
}
}