This sort of thing will work:
#include <iostream>
using namespace std;
int yankAsmTooth ();
int main (int argc, char *argv [])
{
int regVal = yankAsmTooth ();
cout << regVal;
}
int yankAsmTooth ()
{
int a;
__asm
{
mov dword ptr [a],0Ah
}
return a;
} Adapt to your implementation's machine language and your preferred syntax. In my implementation, I could have just put the value in the register used for integer returns and returned, but these things vary. The point is that the machine runs on machine language. Your language must cause that to be emitted, eventually, whether it's compiled, interpreted, or run on a VM of some sort. The machine uses registers. Whatever the language does to move that back and forth across the layer of abstraction, you can also do.