My homework is due tomorrow so any fast help is greatly appreciated!! I need to modify the Hello, world! program in assembly programming for MIPS so that I can display my name on one line and my email on a 2nd line.
I can display my name by using the sample code below, but I can not get my email on the 2nd line, and do not have any ideas how to make this work.
Please help me if you know a simple fix to my problem. Thanks ahead of time.
.data
banner:
.asciiz "my name"
.text
main:
li $v0,4
la $a0,banner
syscall
li $v0,10
syscall
Copyright © 2024 QUIZLS.COM - All rights reserved.
Answers & Comments
Verified answer
I've done assembly for a number of processors, but not MIPS, so I don't know the exact directive, but I know what you need to do. You need to output a "newline" sequence. I think this will work if you just put \n in the string where you want a newline. As in:
.asciiz "my name\[email protected]"
If not, find a way to output an LF character (ascii 10, hex 0A) to the console, probably with another $v0=4 syscall with a0 pointing to a 2 byte string 10,0 (hex 0a, 00).