1 ;; Implementation of some string functions in
4 ;; Why - because I want a better dhrystone score :)
6 ;; strcpy is disabled as the C version is almost as good.
7 ;; Just the setup and return is slower.
9 ; char *strcpy(char *dest, const char *source)
11 ;; Fall through to the correct type
25 ;; Setup the return value
35 ;; Notes on strcpy styles:
36 ;; *de = *hl; hl++; de++; or a; ret z; jp - slower as jp is
37 ;; same cost as conditional jump, so condition on ret is more expensive.
38 ;; *de = *bc; bc++; de++; or a, jp nz - OK
39 ;; Can't use LDI as need to check for end of string.
40 ;; Above also matches the z88dk version.
43 ; void *memcpy(void *dest, const void *source, int count)
45 ;; Fall through to correct type
51 ;; LDIR: do; *DE = *HL; HL++; BC--; while BC != 0
53 ;; All registers are already saved.
72 ;; Pending: could optimise this check to occur earlier.
79 ; int strcmp(const char *s1, const char *s2)
81 ;; Fall through to the correct style
82 ;; Fall through to correct type
103 ;; Normally not taken, so use a jr (12/7) instead of jp (10)
111 ;; Normally taken. Flag from the cp above.