stackoverflow just helped me to make my functions incredibly cute!!
is_digit:
li t0, '0'
sub t1, a0, t0 // c - '0'
li t0, 10
sltu a0, t1, t0
ret
is_letter:
li t0, 'a'
li t1, 26 // ('z'-'a'+1)
ori t2, a0, 0x20 // convert lowercase
sub t3, t2, t0 // lcase - 'a'
sltu a0, t3, t1
ret