Move test in a specific folder

This commit is contained in:
Fabio Scotto di Santolo
2025-11-29 18:47:37 +01:00
parent c59b4004e5
commit 7eaf73e6fe
6 changed files with 0 additions and 0 deletions

25
example/naked.c Normal file
View File

@@ -0,0 +1,25 @@
#include <stdio.h>
// No function prologue/epilogue - raw assembly only
__attribute__((naked))
void my_naked_function()
{
__asm__ volatile (
"movl $42, %eax\n\t"
"ret"
);
}
int main()
{
int result;
__asm__ volatile (
"call my_naked_function\n\t"
"movl %%eax, %0\n\t"
: "=r"(result)
:
: "%eax"
);
printf("Result from naked function: %d\n", result);
return 0;
}