title: assemply-changing the characters of my string
body: <p>So I want to change all the characters on my string with a single character.I have done this:</p>
  
  <pre><code>    .text
      .globl __start
  __start:
  
      la $t2,str# t2 points to the string
      la $a0,str
      li $a1,256
      li $v0,4
      syscall
  
      la $a0,endl # system call to print
      li $v0,4 # out a newline
      syscall
  
      li $t4,'-'
      li $t1,0 # t1 holds the count
      nextCh: lb $t0,($t2) # get a byte from string
      beqz $t0,strEnd # zero means end of string
      sw $t4,($t2)
      add $t1,$t1,1 # increment count
      add $t2,1 # move pointer one character
      j nextCh # go round the loop again
  
      strEnd:
      move $a0,$t1 # system call to print
      li $v0,1 # out the length worked out
      syscall
  
      la $a0,endl # system call to print
      li $v0,4 # out a newline
      syscall
      li $v0,10
      syscall # au revoir...
  
  .data
  str: .asciiz "abcdefghij"
  endl: .asciiz "\n"
  </code></pre>
  
  <p>Which just gives me the string I have stored in the data section and a loop which pretty much gets every character of the string.What should I add to my code so I could get this:</p>
  
  <pre><code>abcdefghij
  ----------
  </code></pre>