Skip to content

X86的汇编写好,编译出现error: inline assembly requires more registers than available,大佬知道怎么解决吗 #4

@shuajinanhai

Description

@shuajinanhai
long ret;
__asm__ volatile (
        "movl %1, %%eax\n\t"
        "movl %2, %%ebx\n\t"
        "movl %3, %%ecx\n\t"
        "movl %4, %%edx\n\t"
        "movl %5, %%esi\n\t"
        "movl %6, %%edi\n\t"
        "movl %7, %%ebp\n\t"
        "int $0x80\n\t"
        "movl %%eax, %0\n\t"
        :"=r"(ret)
        :"r"(num), "r"(arg0), "r"(arg1), "r"(arg2), "r"(arg3), "r"(arg4), "r"(arg5)
        :"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "%ebp"
        );
return ret;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions