title: Pass a memory address by register
body: <p>How do I pass a memory address from a register to other? My following routine receive the string memory address from stack (yes, it's necessary) and then try to put into <code>D1</code> registers but it doesn't work and <a href="http://www.easy68k.com/" rel="nofollow"><strong>EASy68k</strong></a> emulator crash (or goes in an infinite loop?) when I try run this. </p>
  
  <p>Code:</p>
  
  <pre><code>START ORG $1000
  
  
      MOVE.L T,D0
      MOVE.L D0,-(SP)
      BSR PRINTS
  
  
  
  PRINTS:       
          MOVE.L D0,(SP)+
          MOVE.W D0,A1
          MOVE #14,D0
          TRAP #15
          RTS
  
  T DC.B 'HELLO',0
      END START
  </code></pre>
  
  <p><strong>UPDATE:</strong> I updated the way as arguments are pushed and poped from stack. Changed to use <code>PEA</code> instruction that looks like do exactly what I want to but it still doesn't work.</p>
  
  <pre><code>START ORG $1000
          PEA T(PC)
          *MOVE.L D0,-(SP)
          BSR PRINTS
          ADDQ.L #4,SP
  
      MOVE #9,D0       
          TRAP #15 
  
  PRINTS:        
          MOVE 4(SP),A1
          MOVE #14,D0
          TRAP #15
          RTS
  </code></pre>