z80: initial build fixes
authorAlan Cox <alan@linux.intel.com>
Thu, 16 Nov 2017 19:03:03 +0000 (19:03 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 16 Nov 2017 19:03:03 +0000 (19:03 +0000)
13 files changed:
Applications/SmallC/Z80/lib/_ispunct.s [deleted file]
Applications/SmallC/Z80/lib/_isxdigit.s
Applications/SmallC/Z80/lib/_memcpy.s
Applications/SmallC/Z80/lib/_memset.s
Applications/SmallC/Z80/lib/_strcat.s
Applications/SmallC/Z80/lib/_strchr.s
Applications/SmallC/Z80/lib/_strcmp.s
Applications/SmallC/Z80/lib/_strcpy.s
Applications/SmallC/Z80/lib/_strcspn.s
Applications/SmallC/Z80/lib/_strncat.s
Applications/SmallC/Z80/lib/_strncpy.s
Applications/SmallC/Z80/lib/_strrchr.s
Applications/SmallC/Z80/lib/_strspn.s [deleted file]

diff --git a/Applications/SmallC/Z80/lib/_ispunct.s b/Applications/SmallC/Z80/lib/_ispunct.s
deleted file mode 100644 (file)
index 969bf85..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ispunct.s
\ No newline at end of file
index b3a6878..aaaecdd 100644 (file)
@@ -1,5 +1,5 @@
                .code
-               .global _isxdigit
+               .export _isxdigit
 _isxdigit:     pop bc
                pop hl
                push hl
@@ -15,7 +15,7 @@ _isxdigit:    pop bc
                cp '9'+1
                jr nc, ret0
                jr ret1
-ascii1:                add 32
+ascii1:                add a,32
 ascii2:
                cp 'a'
                jr c, ret0
index e978126..3fcf595 100644 (file)
@@ -4,16 +4,17 @@
 _memcpy:       push ix
                ld ix,#0
                add ix,sp
-               ld e,4(ix)
-               ld d,5(ix)
-               ld l,6(ix)
-               ld h,7(ix)
-               ld c,8(ix)
-               ld b,9(ix)
+               ld e,(ix+4)
+               ld d,(ix+5)
+               ld l,(ix+6)
+               ld h,(ix+7)
+               ld c,(ix+8)
+               ld b,(ix+9)
                ld a,b
                or c
                jr z, _memcpy_none
                ldir
-_memcpy_none:  ld l,4(ix)
-               ld h,5(ix)
+_memcpy_none:  ld l,(ix+4)
+               ld h,(ix+5)
+               pop ix
                ret
index b1f4ac7..4bc85d9 100644 (file)
@@ -4,11 +4,11 @@
 _memset:       push ix
                ld ix,0
                add ix,sp
-               ld h,4(ix)
-               ld l,5(ix)
-               ld e,6(ix)
-               ld c,8(ix)
-               ld b,9(ix)
+               ld h,(ix+4)
+               ld l,(ix+5)
+               ld e,(ix+6)
+               ld c,(ix+8)
+               ld b,(ix+9)
                ld a,b
                or c
                jr z, _memset_none
@@ -21,6 +21,7 @@ _memset:      push ix
                ld d,h
                inc de
                ldir
-_memset_none:  ld l,4(ix)
-               ld h,5(ix)
+_memset_none:  ld l,(ix+4)
+               ld h,(ix+5)
+               pop ix
                ret
index 7764f38..d06e374 100644 (file)
@@ -17,9 +17,9 @@ _strcat_2:
                ld a,(hl)
                ld (de),a
                or a
-               jr z _strcat_3
+               jr z,_strcat_3
                inc hl
                inc de
                jr _strcat_2
-strcat_3:      pop de
+_strcat_3:     pop de
                ret
index de206f1..91f7340 100644 (file)
@@ -16,5 +16,3 @@ _strchr_1:    ld a,(hl)       ; "The terminting nul is considered part
                jr nz,_strchr_1
                ld hl,0
                ret
-
-               
\ No newline at end of file
index 4a666f4..e067cfe 100644 (file)
@@ -11,9 +11,9 @@ _strcmp:
 _strcmp_1:
                ld a,(de)
                cp (hl)
-               jr nz, strcmp_2
+               jr nz, _strcmp_2
                or a
-               jr z, strcmp_4
+               jr z, _strcmp_4
                inc hl
                inc de
                jr _strcmp_1
index e1ce611..8317c6d 100644 (file)
@@ -11,7 +11,7 @@ _strcpy:      pop bc          ;ret
 _strcpy_1:     ld a,(hl)
                ld (de),a
                or a
-               jr z _strcpy_2
+               jr z,_strcpy_2
                inc hl
                inc de
                jr _strcpy_1
index 0b77ff0..17f73b6 100644 (file)
@@ -24,7 +24,7 @@ _strcspn_2:
                ret z           ;       Matched HL ponts to right spot
                inc de
                jr _strcspn_2
-_strcpsn_3:    pop de
+_strcspn_3:    pop de
                inc hl
                jr _strcspn_1
 _strcspn_4:    ld h,a          ;       A always 0 here
index bf649eb..3377224 100644 (file)
@@ -5,18 +5,18 @@ _strncat:
                push    ix
                ld      ix,#0
                add     ix,sp
-               ld      l,4(ix)
-               ld      h,5(ix)
+               ld      l,(ix+4)
+               ld      h,(ix+5)
                xor     a
                ld      b,a
                ld      c,a
                ; Move past end of original string
                cpir
                dec     hl
-               ld      e,6(ix)
-               ld      d,7(ix)
-               ld      c,8(ix)
-               ld      b,9(ix)
+               ld      e,(ix+6)
+               ld      d,(ix+7)
+               ld      c,(ix+8)
+               ld      b,(ix+0)
                ; Copy bytes until limit or \0
 _strncat_1:
                ld      a,b
@@ -30,8 +30,8 @@ _strncat_1:
                inc     hl
                dec     bc
                jr      _strncat_1
-_strncat_2:    ld      l,4(ix)
-               ld      h,5(ix)
+_strncat_2:    ld      l,(ix+4)
+               ld      h,(ix+5)
                pop     ix
                ret
                ; Copy \0 until limit
index 317afa9..b5efd43 100644 (file)
@@ -3,14 +3,14 @@
 
 _strncpy:
                push    ix
-               ld      ix,#0
+               ld      ix,0
                add     ix,sp
-               ld      l,4(ix)
-               ld      h,5(ix)
-               ld      e,6(ix)
-               ld      d,7(ix)
-               ld      c,8(ix)
-               ld      b,9(ix)
+               ld      l,(ix+4)
+               ld      h,(ix+5)
+               ld      e,(ix+6)
+               ld      d,(ix+7)
+               ld      c,(ix+8)
+               ld      b,(ix+9)
                ; Copy bytes until limit or \0
 _strncpy_1:
                ld      a,b
@@ -24,8 +24,8 @@ _strncpy_1:
                inc     hl
                dec     bc
                jr      _strncpy_1
-_strncpy_2:    ld      l,4(ix)
-               ld      h,5(ix)
+_strncpy_2:    ld      l,(ix+4)
+               ld      h,(ix+5)
                pop     ix
                ret
                ; Copy \0 until limit
index b970d5c..c707aab 100644 (file)
@@ -24,4 +24,3 @@ _strrchr_3:
                ld b,h
                ld c,l
                jr _strrchr_1
-       
\ No newline at end of file
diff --git a/Applications/SmallC/Z80/lib/_strspn.s b/Applications/SmallC/Z80/lib/_strspn.s
deleted file mode 100644 (file)
index 0b77ff0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-               .code
-               .export _strcspn
-
-_strcspn:
-               pop bc
-               pop hl          ;       string
-               pop de          ;       match
-               push de
-               push hl
-               push bc
-
-_strcspn_1:
-               ld a,(hl)
-               or a
-               jr z,_strcspn_4
-               ld c,a
-
-               push de
-_strcspn_2:
-               ld a,(de)
-               or a
-               jr z, _strcspn_3
-               cp c
-               ret z           ;       Matched HL ponts to right spot
-               inc de
-               jr _strcspn_2
-_strcpsn_3:    pop de
-               inc hl
-               jr _strcspn_1
-_strcspn_4:    ld h,a          ;       A always 0 here
-               ld l,a
-               ret