title: LC-3 How to print two digit number
body: <p>I have an LC-3 program that has a counter. I can print the counter to the screen using TRAP x21. However, if the counter number has two digits my program does not work.</p>
  
  <p>Example: 9 will print perfectly, but not 19. </p>
  
  <p>I am guessing that before I print my Register which contains the counter I need a loop, which will chop the number by dividing by 2 (same as I would in decimal by dividing by 10, but 2 in binary). Then I guess I would print digit1, digit0. I have a problem though, how do I divide in LC-3? Right shift? That seems too hard for this problem and beyond my knowledge.</p>
  
  <p>Please help.</p>
  
  <pre><code>    0010 000 000000011    ; R0 &lt;= x30 which is for  
      0001 000 000 0 00 010 ; R0 &lt;= R0 + R2 
  
      1111 0000 00100001    ; TRAP x21 
      1111 0000 00100101    ; TRAP x25 
      0000000000110000
  </code></pre>