; Doug's Programming Language  -- DPL, Version 2.22
; Copyright (c) 1988 Douglas S. Cody, All rights reserved.
;--------------------------------------
; _IFSEQ  -- IF-STRING-IS-EQUAL ROUTINE
;
; Entry conditions:
;	SI points to the source string
;	DI points to the destination string
; Exit conditions:
;	Carry set if strings are the same
;	Carry clear if the string are not the same
;	SI, DI, AX modified
;
SUBPGM	_IFSEQ
BEGIN	_IFSEQ
;
;  EQUAL-TO FUNCTION
;
	CLD
	PUSH	ES
	PUSH	DS
	POP	ES
;
@IFSEQ_05:
	MOV	AL,[DI]		; FETCH A COPY OF THE CHARACTERS
	CMPSB			; COMPARE BOTH & ADVANCE THE POINTERS
	JNZ	@IFS_10		; EXIT IF NOT THE SAME
	OR	AL,AL		; EOT?
	JNZ	@IFSEQ_05	; NO, CONTINUE LOOPING
;
@IFS_07:
	STC			; SET CARRY - TRUE RESULT
	POP	ES
	RET
;
@IFS_10:
	CLC			; CLEAR CARRY, FALSE RESULT
	POP	ES
	RET
;
; _IFSNE  -- IF-STRING-IS-NOT-EQUAL ROUTINE
;
; Entry conditions:
;	SI points to the source string
;	DI points to the destination string
; Exit conditions:
;	Carry set if strings are the same
;	Carry clear if the string are not the same
;	SI, DI, AX modified
;
	PUBLIC	_IFSNE
_IFSNE	PROC	NEAR
	CLD
	PUSH	ES
	PUSH	DS
	POP	ES
;
@IFSNE_05:
	MOV	AL,[DI]		; FETCH A COPY OF THE CHARACTERS
	CMPSB			; COMPARE BOTH & ADVANCE THE POINTERS
	JNZ	@IFS_07		; EXIT GOOD IF NOT THE SAME
	OR	AL,AL		; EOT?
	JNZ	@IFSNE_05	; NO, CONTINUE LOOPING
	JMP	SHORT @IFS_10	; EXIT BAD IF THE SAME

_IFSNE	ENDP
;
ENDPGM	_IFSEQ
;