title: Printing a binary number in LC-3 Assembly
body: <p>I'm trying to print a binary number to the console using LC-3 assembly.</p>
  
  <p>What I've tried so far includes (but isn't limited to):</p>
  
  <pre><code>        binary .fill b10000110
          lea r0, binary
          puts ; prints garbage
          ld r0, binary
          out ; prints 0 (I know it only prints one character but I don't know why it chooses to print 0)
          lea r1, binary
          and r2, r2, #0
  loop    ldr r0, r1, r2
          out
          add r2, r2, #1
          and r3, r3, #0
          not r3, r2
          add r3, r3, #1
          add r3, r3, #8 ; I know all the binary numbers will be exactly 8 bits long
          brz end
          add r3, r3, #0 ; to be safe
          brnzp loop
  end
          ; more code...
  </code></pre>
  
  <p>None of this works particularly well. I'm pulling my hair out trying to figure out the proper way to do this, but everything I'm thinking of relies on <code>binary</code> being a string, which I can't do.</p>