title: Beginner Errors On When Compiling a MIPS Assembly Source
body: <p>I'm trying to learn MIPS Assembly by learning <a href="https://rads.stackoverflow.com/amzn/click/0131420445" rel="nofollow noreferrer">MIPS Assembly Language Programming</a>. In the book I have this code(<strong>extracted from the page 37 of the book</strong>):</p>
  
  <pre><code>.data
  prompt: .asciiz "\n Please Input a Value: "
  bye: .asciiz "\n Bye!"
  .globl main
  .text
  
  main:
     li $v0, 4
     la $a0, prompt
     syscall
  
     li $v0, 5
     syscall
     beqz $v0, end
     move $a0, $v0
     li $v0, 1
     syscall
     b main
  
  
  end:
     li $v0, 4
     la $a0, bye
     syscall
  
     li $v0, 10
     syscall
  </code></pre>
  
  <p>I have a <a href="http://www.ifp.illinois.edu/~nakazato/tips/xgcc.html" rel="nofollow noreferrer">cross-compiled binutils</a> targeted to <code>mips-elf</code>, but when I've tried  to Assemble the code, I got some errors</p>
  
  <blockquote>
    <p>ubuntu@eeepc:~/Desktop$ mips-elf-as test-mips.asm<br>
    test-mips.asm: Assembler messages:<br>
    test-mips.asm:8: Error: illegal operands 'li'<br>
    test-mips.asm:9: Error: illegal operands 'la'<br>
    test-mips.asm:12: Error: illegal operands 'li'<br>
    test-mips.asm:14: Error: illegal operands 'beqz'<br>
    test-mips.asm:15: Error: illegal operands 'move'<br>
    test-mips.asm:16: Error: illegal operands 'li'<br>
    test-mips.asm:22: Error: illegal operands 'li'<br>
    test-mips.asm:23: Error: illegal operands 'la'<br>
    test-mips.asm:26: Error: illegal operands 'li'<br>
    ubuntu@eeepc:~/Desktop$</p>
  </blockquote>
  
  <p><strong>I'm using x86 Ubuntu Hardy Herron to cross-compile to MIPS</strong></p>
  
  <p>What is wrong?</p>