Yes, you can::
call("functionwithasmcode.asm");
This function will have to:
- Invoke the assembler and linker - create the dynamic link library.
- Depending on the system you need to load this library (for example in Linux by calling the
dlopen
function, in Windows LoadLibrary
).
- Find your function in the library, assign to function pointer (it is also OS dependant for example in Linux
dlsym
, windows GetProcAddress
)
- call the function using the function pointer from the point 3.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…