evenfri

content

coding standards

1. formatting & layout

2. naming conventions

3. function design

4. comments & headers

5. dependencies & build

6. required files

example

/*
 * main.c — entry point example
 */

#define SYS_write 1
#define STDOUT 1

static long write(int fd, const void *buf, unsigned long count) {
  long ret;
  asm volatile (
    "syscall"
    : "=a"(ret)
    : "a"(SYS_write), "D"(fd), "S"(buf), "d"(count)
    : "rcx", "r11", "memory"
  );
  return ret;
}

int main(int argc, char *argv[]) {
  write(STDOUT, "hello world\n", 12);

  return 0;
}

submitting patches