#asm code
[…so I thought to convert it to C++ by doing
short Foo(register short x)
{
return ((x<<1) ^ 0x1021);
}…]
One thing you could do is declare it as an inline function
inline short Foo(register short x)
{
return ((x<<1) ^ 0x1021);
}