* $Revision Header * Header built automatically - do not edit! ************* * * (C) Copyright 1990 by MXM * * Name .....: StringAsm.asm * Created ..: Friday 13-Apr-90 15:56 * Revision .: 0 * * Date Author Comment * ========= ======== ==================== * 13-Apr-90 Olsen Created this file! * * $Revision Header ********************************************************* * * This file contains the assembly language source code for * the string routines employed by rexxhost.library. * **************************************************************************** SECTION StringAsm,CODE XDEF _StrLen XDEF _StrCpy XDEF _StrNCpy *---------------------------------------------------------------------------- _StrLen: MOVEQ #0,D0 ; Reset counter 1$ TST.B (A0)+ ; Test for 0 BEQ.S 2$ ; End of string ADDQ #1,D0 ; Increment length counter BRA.S 1$ ; Test again... 2$ RTS *---------------------------------------------------------------------------- _StrCpy: TST.B (A1) ; Empty string? BEQ.S 1$ MOVE.B (A1)+,(A0)+ ; Copy character BRA.S _StrCpy ; Check for 0 1$ MOVE.B #0,(A0) ; Null-termination RTS *---------------------------------------------------------------------------- _StrNCpy: TST.L D0 ; Legal length? BEQ.S 2$ 1$ MOVE.B (A1)+,(A0)+ ; Copy character DBRA D0,1$ ; Decrement length counter 2$ MOVE.L D0,A1 ; Null-termination MOVE.B #0,0(A0,A1) RTS *---------------------------------------------------------------------------- END