*------------------------------------------------------------------------------ * NAME STR_COPY *------------------------------------------------------------------------------ * DEPENDENCY None * PURPOSE Copy the string at (A2) to the string at (A1) overwriting. * DESCRIPTION Copies the string whose address is passed in A2 over the * string whose address is passed in A1 thus overwriting the * old contents of the receiving string. * INPUTS : * A1.L = Address of the receiving string * A2.L = Address of the sending string * OUTPUTS : * A1.L = Address of the receiving string (preserved) * A2.L = Address of the sending string (preserved) *------------------------------------------------------------------------------ str_copy movem.l d0/a1-a2,-(a7) ; Preserve working register move.w (a2)+,d0 ; Get size of 'from' string move.w d0,(a1)+ ; Set new size of 'to' string bra.s sc_next ; Skip the dbra stuff first time round sc_moveb move.b (a2)+,(a1)+ ; Move a single byte sc_next dbra d0,sc_moveb ; And the rest movem.l (a7)+,d0/a1-a2 ; Restore working registers rts ; Exit