/* Write an ARM assembly function that takes three constants as inputs from C program,
perform ADD operation and returns the result to the C program. */
#include <stdio.h>
#include <stdlib.h>
extern "C"{
int my_add_asm(int x,int y, int z); //2 parameters.
}
void setup() {
Serial1.begin(9600); //initialising the serial port.
}
int main()
{
int x,y,z,result;
printf("Enter the 1st value: ");
scanf("%d",&x);
printf("%d\n",x); //to make sure it shows up on the serial monitor.
printf("Enter the 2nd value: ");
scanf("%d",&y);
printf("%d\n",y); //to make sure it shows up on the serial monitor.
printf("Enter the 3rd value: ");
scanf("%d",&z);
printf("%d\n",z); //to make sure it shows up on the serial monitor.
result = my_add_asm(x,y,z);
printf("\nResult : %d \n",result);
}