orangy
val myLib = C {"""
#include <stdio>
void say_hello() {
int src = 1;
int dst;
asm ("mov %1, %0\n\t"
"add $1, %0"
: "=r" (dst)
: "r" (src));
printf("%d\n", dst);
}
"””}
val sayHello : ()->Unit = myLib[“say_hello”]
fun main(args: Array<String>) {
sayHello()
}