title: MIPS int read byte by byte to hex
body: <p>This is the prompt:
  Part I
  Write a MIPS assembly language program to
  1. Prompt the user for an integer (that could be positive or negative)
  2. Store that number in a memory location labeled MyNumber
  3. Read that number byte-by-byte into register $t0 then print out that byte in hexadecimal, starting from lower address, with each byte is preceded with a string to indicate the byte position.
  For example:
  B0   0x 0A
  B1   0x 12
  B2   0x 65
  B3   0xBE</p>
  
  <p>I am at a loss of how to approach the conversion of an int into it's 4 bytes and then converting those to hex.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>.data
  prompt:     .asciiz "Enter an integer (positive or negative): "
  MyNumber:       .word 0
  output:         .word 0
  space:          .space 20
  
  .text
  main:
      addi $v0, $zero, 4  #code 4 is to print string
      la $a0, prompt      #loads string into register
      syscall
  
      addi $v0, $zero, 5  #code 5 is to read an integer
      syscall
  
      sw $v0, MyNumber        #stores value from $v0 to input
  
      la $t1, MyNumber
  </code></pre>