TLB routines rewritten from assembler into C.