; Doug's Programming Language  -- DPL, Version 2.22
; Copyright (c) 1988 Douglas S. Cody, All rights reserved.
;----------------------------------
; _STREND  -- MOVE THE TEXT POINT TO THE END OF THE STRING
;
; Entry conditions:
;	SI holds the offset to the beginning of the string
; Exit conditions:
;	SI points to the terminator in the string
;	CX holds the length of the text, but not the terminator
;
SUBPGM	_STREND
BEGIN	_STREND
	SUB	AL,AL
	SUB	CX,CX
	DEC	SI
;
LOOPR:
	INC	SI
	CMP	AL,[SI]		; NULL TERMINATOR?
	LOOPNE	LOOPR		; IF NOT, CONTINUE LOOPING
	NEG	CX
	DEC	CX
	RET
;
;
; _STRLEN  -- GET THE LENGTH OF THE SOURCE STRING INTO CX
;
; Entry conditions:
;	SI holds the offset to the beginning of the string
; Exit conditions:
;	SI not changed
;	CX holds the length of the text, but not the terminator
;
	PUBLIC	_STRLEN
_STRLEN	PROC	NEAR
	PUSH	SI
	CALL	_STREND
	POP	SI
	RET

_STRLEN	ENDP
;
ENDPGM	_STREND
;