|
|
1.1 root 1: //////////
2: / i8086 C string library.
3: / streq()
4: / Not in ANSI draft standard.
5: //////////
6:
7: //////////
8: / streq(String1, String2)
9: / char *String1, *String2;
10: /
11: / Compare String1 and String2 for equality, return 1 or 0.
12: //////////
13:
14: #include <larges.h>
15:
16: String1 = LEFTARG
17: String2 = String1+DPL
18:
19: Enter(streq_)
20: Lds si, String2(bp) / String2 address to DS:SI
21: Les di, String1(bp) / String1 address to ES:DI
22: mov cx, $0 / Result to CX
23: cld
24:
25: 1: lodsb / String2 character to AL
26: scasb / Compare to String1 character
27: jne 2f / Mismatch, return 0
28: orb al, al
29: jne 1b / Not done yet
30: inc cx / Matched, return 1
31:
32: 2: mov ax, cx / Result to AX
33: Leave
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.