root / op_string.h @ b67d5959
History | View | Annotate | Download (2.1 kB)
1 |
|
---|---|
2 |
void OPPROTO glue(glue(op_repz_scas, SUFFIX), STRING_SUFFIX)(void) |
3 |
{ |
4 |
int v1, v2, inc;
|
5 |
|
6 |
if (CX != 0) { |
7 |
/* NOTE: the flags are not modified if CX == 0 */
|
8 |
v1 = EAX & DATA_MASK; |
9 |
inc = (DF << SHIFT); |
10 |
do {
|
11 |
v2 = glue(ldu, SUFFIX)(DI_ADDR); |
12 |
INC_DI(); |
13 |
DEC_CX(); |
14 |
if (v1 != v2)
|
15 |
break;
|
16 |
} while (CX != 0); |
17 |
CC_SRC = v2; |
18 |
CC_DST = v1 - v2; |
19 |
CC_OP = CC_OP_SUBB + SHIFT; |
20 |
} |
21 |
FORCE_RET(); |
22 |
} |
23 |
|
24 |
void OPPROTO glue(glue(op_repnz_scas, SUFFIX), STRING_SUFFIX)(void) |
25 |
{ |
26 |
int v1, v2, inc;
|
27 |
|
28 |
if (CX != 0) { |
29 |
/* NOTE: the flags are not modified if CX == 0 */
|
30 |
v1 = EAX & DATA_MASK; |
31 |
inc = (DF << SHIFT); |
32 |
do {
|
33 |
v2 = glue(ldu, SUFFIX)(DI_ADDR); |
34 |
INC_DI(); |
35 |
DEC_CX(); |
36 |
if (v1 == v2)
|
37 |
break;
|
38 |
} while (CX != 0); |
39 |
CC_SRC = v2; |
40 |
CC_DST = v1 - v2; |
41 |
CC_OP = CC_OP_SUBB + SHIFT; |
42 |
} |
43 |
FORCE_RET(); |
44 |
} |
45 |
|
46 |
void OPPROTO glue(glue(op_repz_cmps, SUFFIX), STRING_SUFFIX)(void) |
47 |
{ |
48 |
int v1, v2, inc;
|
49 |
if (CX != 0) { |
50 |
inc = (DF << SHIFT); |
51 |
do {
|
52 |
v1 = glue(ldu, SUFFIX)(SI_ADDR); |
53 |
v2 = glue(ldu, SUFFIX)(DI_ADDR); |
54 |
INC_SI(); |
55 |
INC_DI(); |
56 |
DEC_CX(); |
57 |
if (v1 != v2)
|
58 |
break;
|
59 |
} while (CX != 0); |
60 |
CC_SRC = v2; |
61 |
CC_DST = v1 - v2; |
62 |
CC_OP = CC_OP_SUBB + SHIFT; |
63 |
} |
64 |
FORCE_RET(); |
65 |
} |
66 |
|
67 |
void OPPROTO glue(glue(op_repnz_cmps, SUFFIX), STRING_SUFFIX)(void) |
68 |
{ |
69 |
int v1, v2, inc;
|
70 |
if (CX != 0) { |
71 |
inc = (DF << SHIFT); |
72 |
do {
|
73 |
v1 = glue(ldu, SUFFIX)(SI_ADDR); |
74 |
v2 = glue(ldu, SUFFIX)(DI_ADDR); |
75 |
INC_SI(); |
76 |
INC_DI(); |
77 |
DEC_CX(); |
78 |
if (v1 == v2)
|
79 |
break;
|
80 |
} while (CX != 0); |
81 |
CC_SRC = v2; |
82 |
CC_DST = v1 - v2; |
83 |
CC_OP = CC_OP_SUBB + SHIFT; |
84 |
} |
85 |
FORCE_RET(); |
86 |
} |
87 |
|
88 |
#undef STRING_SUFFIX
|
89 |
#undef SI_ADDR
|
90 |
#undef DI_ADDR
|
91 |
#undef INC_SI
|
92 |
#undef INC_DI
|
93 |
#undef CX
|
94 |
#undef DEC_CX
|