1
0

Coses bàsiques de ARM assembly en un programa de C

This commit is contained in:
2025-11-07 22:57:41 +01:00
parent 74ef361d0f
commit 988261cea8
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
#include <stdio.h>
extern int my_function(int a, int b);
int main()
{
int a = 6;
int b = 4;
printf("Calling assembly function my_function with x0=%d and x1=%d results in %d\n", a, b, my_function(a, b));
return (0);
}

View File

@@ -0,0 +1,6 @@
.global my_function
.type my_function, "function"
.p2align 4
my_function:
add x0, x0, x1
ret