Replace Tmem_nasm.asm with C++ code. Patch by pyro.