Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
116 additions
and
814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
; char *_stpcpy(char *to, const char *from) | ||
public _stpcpy | ||
_stpcpy proc DIST | ||
|
||
@@len = word ptr -2 | ||
@@to = dword ptr 6 | ||
@@from = dword ptr 0Ah | ||
|
||
push bp | ||
mov bp, sp | ||
sub sp, 2 | ||
push si | ||
push di | ||
push word ptr [bp+@@from+2] | ||
push word ptr [bp+@@from] ; s | ||
nop | ||
call _strlen | ||
pop cx | ||
pop cx | ||
mov [bp+@@len], ax | ||
inc ax | ||
push ax ; n | ||
push word ptr [bp+@@from+2] | ||
push word ptr [bp+@@from] ; src | ||
push word ptr [bp+@@to+2] | ||
push word ptr [bp+@@to] ; dest | ||
nop | ||
call _memcpy | ||
add sp, 0Ah | ||
mov dx, word ptr [bp+@@to+2] | ||
mov ax, word ptr [bp+@@to] | ||
add ax, [bp+@@len] | ||
pop di | ||
pop si | ||
mov sp, bp | ||
pop bp | ||
ret | ||
_stpcpy endp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.