title: Trap Subroutine LC3 Assembly
body: <p>Hi I have a problem for a cs class</p>
  
  <pre><code>       The puts TRAP routine has been disabled for some reason. Write an LC-3 
        subroutine called puts that
    implements its behaviour. In other words when the subroutine is called 
   register R0 will contain the
   address of a null-delimited string and the subroutine will simply print the 
  string and return. You will of
  course need to utilize the TRAP routine out that prints a character. 
  </code></pre>
  
  <p>do 
    NOT have to write a main
    program.</p>
  
  <p>So my approach to this was this I'm not sure if this is correct or if my logic is right</p>
  
  <pre><code>    PUTS:      
      ADD R2, R0, #0;
      AND R0, R0, #0;
      ADD R0, R2, #0;
  
      Out(trapx21) ; print first char in r0;
  
  
      BRp PUTS ; repeat loop 
  </code></pre>
  
  <p>I'm not sure if i'm doing this correctly any help?</p>