Trailing-Edge
-
PDP-10 Archives
-
decuslib10-08
-
43,50512/string.b36
There are 22 other files named string.b36 in the archive. Click here to see a list.
MODULE STRING=
!General-purpose string-handling functions
BEGIN
FORWARD ROUTINE
MOVEAZ;
GLOBAL ROUTINE MOVEAZ(SPTR,DPTR)=
!Copy an ASCIZ string
!SPTR: ADDRESS OF source byte pointer (returned untouched)
!DPTR: ADDRESS OF destination byte pointer (returned updated)
!Returns length of string
BEGIN
LOCAL SP;
LOCAL C; !Character we just read
SP=..SPTR; !Make a copy of source pointer
INCR LEN FROM 0 BY 1 DO
BEGIN
IF (C=CH$RCHAR_A(SP)) EQL 0 THEN
(CH$WCHAR(0,..DPTR); RETURN .LEN);
!Make ASCIZ string of dest, but don't bump DPTR past null byte
CH$WCHAR_A(.C,.DPTR)
END;
END; !MOVEAZ
END ELUDOM