Can you explain a bit more of that, step by step?
Why is stdlib.h used here?
Also, I thought that to set attributes like dllexport, you needed to use __attributes__((dllexport)) directive, not __declspec (which isn't even mentioned in the TCC manual). Also, I thought that to make it stdcall, you needed to use __attributes__((stdcall)), not a standalone __stdcall. These are the "weird" things that set TCC apart from all other C compilers I thought, yet you say these C compiler standards also work in TCC?
And by the way, I think __stdcall (with 2 underscores) for setting the use of STDCALL calling convention is a Microsoft thing (as used in VC++). The official C standard for setting the use of STDCALL calling convention is actually supposed to be _stdcall (with 1 underscore). Isn't that correct?
And why use asm("zzz") as in your example? I think that sets up the compiler for compiling assembly code, not C code, meaning the function must then be written in assembly language.