mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-12-05 23:23:26 +00:00
11 lines
128 B
C
11 lines
128 B
C
int foo(int a, int b)
|
|
{
|
|
int sum;
|
|
asm volatile(
|
|
"nop\n"
|
|
"add %0, %1, %2"
|
|
:"=r"(sum)
|
|
:"r"(a), "r"(b)
|
|
);
|
|
return sum;
|
|
} |