Implement cardinal direction translation in MIPS