Inline ASM with the InlineC library for Python.

Currently busy trying out getting Inline ASM to work with the InlineC lib for Python.
The lib can be found here.


The "test" written on the githube page is as follows;

# coding: inlinec
from inlinec import inlinec
@inlinec
def Q_rqsrt(number):
  float Q_rsqrt(float number)
{
  long i;
  float x2, y;
  const float threehalfs = 1.5F;
  x2 = number * 0.5F;
  y = number;
  i = * (long * ) &y;
  i = 0x5f3759df - ( i >> 1 );
  y = * ( float * ) &i;
  y = y * ( threehalfs - ( x1 * y * y ) );

  return y;
}
print(Q_rsqrt(1.234))

So that looks kind of nice.. now let's hack it. :D

I'm going to spin up the included docker container, and try the following code in it;
# coding: inlinec
from inlinec import inlinec
@inlinec
#include
int main(void)
{
  register int   syscall_no   asm("rax") = 1;
  register int   arg1   asm("rdi") = 1;
  register char*   arg2   asm("rsi") = "Hello, world!\n");
  register int   arg3   asm("rdx") = 14;
  asm("syscall");
  return 0;
}