The easy way to write assembler for a machine with no compilers is to write the code in C, get the algorithm right, then translate it to asm.