Error in mips assembly when trying to print new line

434 views Asked by At

I'm new to assembly and I'm trying to output the division and modulus of two numbers, and so far I was successful. I can print the two numbers with space separating them be making a space character, but when I try to print a new line character '\n', I get syntax error... Here is a snippet:

        .text
main:   #-------------------
        addi    $t0, $0, 60
        addi    $t1, $0, 7
        #-------------------
        div     $t0, $t1        #Divide the two numbers
        mflo    $a0             #store division
        addi    $v0, $0, 1      #Call service 1 to print integers
        syscall                 #print
        #-------------------
        addi    $v0, $0, 11     #Call service 11 to print characters
        add     $a0, $0, '\n'   #print new line
        syscall                 #print
        #-------------------
        div     $t0, $t1        #Divide the two numbers
        mfhi    $a0             #Store modulus
        addi    $v0, $0, 1      #Call service 1 to print integers
        syscall                 #print
0

There are 0 answers