# high-level call: int strlen (char s[])
# Function: return the length of the string s[]
# Compiler assignment: $a0 <- s


.text

#------------------------------------------------
main:       la       $a0,Str           # load base address of s[]
            jal      strlen

#------------------------------------------------
            ori      $2,$0,10          # system call: exit program
            syscall

#----- start your code here


#----- end your code here

# The assembler inserts the data for you intsead of doing it by hand
# one word at a time using the Setting -> Set Value... menu

.data

#------------------------------------------------
Str:      .asciiz "Hello world!"      # null-terminated ASCII string


# Note
#
# The string in ASCII (hex): 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 00
# Your PC is little endian so the first word really is: 6c 6c 65 48 and so on