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 D1 registers but it doesn't work and EASy68k emulator crash (or goes in an infinite loop?) when I try run this.
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
UPDATE: I updated the way as arguments are pushed and poped from stack. Changed to use PEA instruction that looks like do exactly what I want to but it still doesn't work.
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