Modularized ASM code.  I have no idea if this works in practice, but it seems to be all fine