Skip to content

Feature request: implement Windows X86 thiscall #8

@gynt

Description

@gynt

Basically, the first argument to a function specified as a thiscall (calling convention, attributes(thiscall)) should be placed into ECX, all other arguments are pushed to the stack, the callee does stack cleanup. It is a windows stdcall with the first argument passed to ecx. This feature would allow calling into C++ libraries.

// Calling this function:
attributes(thiscall) void f(void* this, int a, int b, int c);

// e.g., using this line: f((void*) 0xBEEFBEEF, 1, 2, 3)
// Should produce this code:
push 3
push 2
push 1
mov ecx, 0xBEEFBEEF 
call f // the callee cleans up the stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions