forked from cc65/cc65
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
5e5dd1d
commit 55d3a6e
Showing
4 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
; | ||
; Colin Leroy-Mira, 4 Sept. 2024 | ||
; | ||
; char* stpcpy (char* dest, const char* src); | ||
; | ||
|
||
.export _stpcpy | ||
.import _strcpy | ||
|
||
.importzp tmp1, ptr2 | ||
|
||
_stpcpy: | ||
jsr _strcpy | ||
|
||
ldx ptr2+1 ; Load dest pointer's last high byte | ||
tya ; Get the last offset strcpy wrote to | ||
|
||
clc | ||
adc ptr2 ; Add to low byte value | ||
bcc :+ | ||
inx | ||
: rts ; Return pointer to dest's terminator |
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