Try to use the ALIAS directive:
.code
ALIAS <add> = <myAdd>
myAdd proc
mov rax, rcx
add rax, rdx
ret
myAdd endp
end
extern "C" int add( int a, int b );
. . .
int x = add( 10, 20 ); // result: 30
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How can I write assembler code that
This is not a problem for masm32 as all functions are really called _func , ie _add
But x64 calling convention retains the function snames
nasm can do this but as far as I can see ml64 cannot
Try to use the ALIAS directive:
.code
ALIAS <add> = <myAdd>
myAdd proc
mov rax, rcx
add rax, rdx
ret
myAdd endp
end
extern "C" int add( int a, int b );
. . .
int x = add( 10, 20 ); // result: 30