1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-03-11 17:41:49 +00:00

Add strzpaste and scrstrzpaste

This commit is contained in:
Karol Stasiak
2019-11-04 02:29:16 +01:00
parent 4abfab41df
commit 00841d685b
6 changed files with 76 additions and 1 deletions

View File

@@ -38,6 +38,18 @@ void strzcopy(pointer dest, pointer src) {
? JP NZ, ___strzcopy_loop
}
}
void strzpaste(pointer dest, pointer src) {
asm {
? LD HL,(src)
? LD DE,(dest)
___strzpaste_loop:
LD A,(HL)
? CP nullchar
? RET Z
LD (DE),A
? JP ___strzpaste_loop
}
}
#else
void strzcopy(pointer dest, pointer src) {
byte c
@@ -48,4 +60,14 @@ void strzcopy(pointer dest, pointer src) {
dest += 1
} while c != nullchar
}
void strzpaste(pointer dest, pointer src) {
byte c
while true {
c = src[0]
if c == nullchar { return }
dest[0] = c
src += 1
dest += 1
}
}
#endif