1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-11-01 05:05:32 +00:00

8080: Faster strzcpy

This commit is contained in:
Karol Stasiak 2019-09-25 01:16:15 +02:00
parent 2ff86889db
commit a69937d8dd

View File

@ -26,6 +26,19 @@ sbyte strzcmp(pointer str1, pointer str2) {
}
}
#if CPUFEATURE_Z80 || CPUFEATURE_8080
void strzcopy(pointer dest, pointer src) {
asm {
? LD HL,(src)
? LD DE,(dest)
___strzcopy_loop:
LD A,(HL)
LD (DE),A
? CP nullchar
? JP NZ, ___strzcopy_loop
}
}
#else
void strzcopy(pointer dest, pointer src) {
byte c
do {
@ -35,3 +48,4 @@ void strzcopy(pointer dest, pointer src) {
dest += 1
} while c != nullchar
}
#endif