X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Flib%2Fz80%2Fasm_strings.s;h=1796b4a57017f580289701ea007a989c4517baae;hb=adbf81ce9358d49c33aa068aeaac2ffaf8738a12;hp=a6527fb97f5adb1575db4194b69055aa5d0c5d87;hpb=c28fc1ac69c4cd64be2c3da520eb0e52e842065a;p=fw%2Fsdcc diff --git a/device/lib/z80/asm_strings.s b/device/lib/z80/asm_strings.s index a6527fb9..1796b4a5 100644 --- a/device/lib/z80/asm_strings.s +++ b/device/lib/z80/asm_strings.s @@ -51,29 +51,21 @@ __memcpy_rrx_s:: ;; LDIR: do; *DE = *HL; HL++; BC--; while BC != 0 ;; All registers are already saved. - ld hl,#2 - add hl,sp - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld a,(hl) - inc hl - ld b,(hl) - inc hl - ld c,(hl) - inc hl - ld h,(hl) - ld l,a - ld a,h - ld h,b - ld b,a - - ;; Pending: could optimise this check to occur earlier. - or c - ret z - - ldir + pop iy ; iy = return address + pop de ; de = destination pointer + pop hl ; hl = source pointer + pop bc ; bc = count + push bc + push hl + push de + ld a,b + or c + jr z,1$ + ldir +1$: + pop hl ; return hl = original destination pointer + push hl + jp (iy) ret ; int strcmp(const char *s1, const char *s2)