# high-level call: void strcpy (char x[], char y[])
# Function: copy string at y[] to x[], return nothing
# Compiler assignment: $a0 <- x, $a1 <- y


.text

#------------------------------------------------
main:       la       $a0,To            # load base address of x[]
            la       $a1,From          # load base address of y[]
            jal      strcpy

#------------------------------------------------
            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

#------------------------------------------------
From:      .asciiz "Hello world!"      # null-terminated ASCII string
To:        .asciiz ""

# 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