Hi I would like to tell gcc how to call functions, for example:
__mycall void my_function(arg1) {
do_something(arg1)
}
__mycall:
move $a0, (the first argument)
jalr (the function we should call)
nop
I would like the generated assembly code of:
my_function(1);
To be
move $a0, 1
jalr my_function
nop
I obviously don't want to implement stdcall or fastcall or something like that, i just explained by an example.
I don't think it should be hard to do that but I don't find any example on how to do that I can write inline assembly and call my function with inline assembly but it is ugly, I will appreciate help (:
question from:https://stackoverflow.com/questions/65645610/how-to-make-change-gcc-calling-convention