title: How to write a string into a .txt file in MIPs Assembly?
body: <p>I am having trouble writing a string into a file in MIPs. I want to write "Hello World!" to the file but instead it wrote "效汬⁯潗汲Ⅴ䌀畯摬❮⁴灏湥映汩e慃⁮灯湥映汩" which I'm pretty sure is a mix of characters with a specific unicode. I don't know why it does that. </p>
  
  <p>Here's the code I have. What am I doing wrong?: </p>
  
  <pre><code>.text
  .globl main
  
  main:
      # Open file
      li $v0,13           # open_file syscall code = 13
      la $a0,fileName # get the file name
      li $a1,1            # file flag = write
      syscall
      move $s6,$v0        # save the file descriptor 
  
      #write into the file
      li $v0, 15              # write_file syscall code = 15
      move $a0, $s6          # file descriptor (fileName)
      la $a1, helloWorld      # the text that will be written in the file
      li $a2, 44              # file size? 
      syscall
  
      #close the file
      li $v0, 16      # close_file syscall code
      syscall
  
      j Exit
  
  Exit:
  
  .data
  fileName: .asciiz "F:/HelloWorld.txt"
  helloWorld: .asciiz "Hello World!"      # This will be written into the file
  </code></pre>