File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,17 +17,16 @@ _strrstr:
1717 ld bc, 0
1818 cpir
1919 sbc hl, hl
20- dec hl
21- sbc hl, bc ; carry will be cleared
20+ scf
21+ sbc hl, bc ; carry will be set
2222 ex (sp), hl ; strlen(needle)
2323 push hl ; needle
2424
2525 ex de, hl
2626 push hl
27- ld bc, 0
27+ ld bc, -1
2828 cpir
2929 sbc hl, hl
30- dec hl
3130 sbc hl, bc
3231 ex (sp), hl ; strlen(haystack)
3332 push hl ; haystack
Original file line number Diff line number Diff line change @@ -24,17 +24,16 @@ _strstr:
2424 ld bc, 0
2525 cpir
2626 sbc hl, hl
27- dec hl
28- sbc hl, bc ; carry will be cleared
27+ scf
28+ sbc hl, bc ; carry will be set
2929 ex (sp), hl ; strlen(needle)
3030 push hl ; needle
3131
3232 ex de, hl
3333 push hl
34- ld bc, 0
34+ ld bc, -1
3535 cpir
3636 sbc hl, hl
37- dec hl
3837 sbc hl, bc
3938 ex (sp), hl ; strlen(haystack)
4039 push hl ; haystack
You can’t perform that action at this time.
0 commit comments