I am having real problems trying debug my code to malfunctioning print statements. I am using MARS MIPS simulator. The following code prints:
degree! test degree! test
When it should print
degree! test
.data
test: .ascii "degree!\n"
test4: .ascii "test\n"
.text
main:
la $a0, test
li $v0, 4
syscall
la $a0, test4
li $v0, 4
syscall
j EXIT
EXIT:
The strings are not null-terminated. Use .asciiz
instead of .ascii
You need to use .asciiz
instead of .ascii
to get NULL terminated strings.