10 void func_header(char *s)
12 printf("\t.globl %1$s\n\t.type %1$s, @function\n%1$s:\n", s);
15 void move(char *src, char *dst)
17 if(strcmp(src,dst) != 0) {
18 printf("\tmovq %%%s, %%%s\n", src, dst);
22 void moveimm(long imm, char *dst)
25 sprintf(buf, "$%li", imm);
26 printf("\tmovq %s, %%%s\n", buf, dst);
34 char *next_reg(char *s, short skip)
36 /* TODO: warum enthaelt das register die parameter enthalten koennten? */
37 char *regs[] = {"rax", "r10", "r11", "r9", "r8", "rcx", "rdx", "rsi", "rdi"};
39 if (s != (char*) NULL) {
41 if(!strcmp(s, regs[i++])) {
50 fprintf(stderr, "next_reg(): %s\n", regs[i]);
56 char *param_reg(int num)
58 char *regs[] = {"rdi", "rsi", "rdx", "rcx", "r8", "r9"};