deriv LSK ETT STT aSTA ALPH OLDHOMEPAGE NEWHOMEPAGE
In spelling, the /sandhi of final m म् is very simple: spell it as M ं before all consonants, but as m म् elsewhere.
However, in actual pronunciation it is trickier: you MUST apply rule anusvArasy... before all the stops and nasals.
See also sandhi of consonant before consonant.