;; Originally from GBDK by Pascal Felber.
.area _CODE
-__divschar_rr_s::
+__divschar_rrx_s::
ld hl,#2+1
add hl,sp
ld l,(hl)
;; Fall through
-__divschar_rr_hds::
+__divschar_rrx_hds::
ld c,l
call .div8
ret
-__modschar_rr_s::
+__modschar_rrx_s::
ld hl,#2+1
add hl,sp
ld l,(hl)
;; Fall through
-__modschar_rr_hds::
+__modschar_rrx_hds::
ld c,l
call .div8
ret
-__divsint_rr_s::
+__divsint_rrx_s::
ld hl,#2+3
add hl,sp
ld h,a
;; Fall through
-__divsint_rr_hds::
+__divsint_rrx_hds::
ld b,h
ld c,l
ret
-__modsint_rr_s::
+__modsint_rrx_s::
ld hl,#2+3
add hl,sp
ld h,a
;; Fall through
-__modsint_rr_hds::
+__modsint_rrx_hds::
ld b,h
ld c,l
ret
;; Unsigned
-__divuchar_rr_s::
+__divuchar_rrx_s::
ld hl,#2+1
add hl,sp
ld l,(hl)
;; Fall through
-__divuchar_rr_hds::
- push ix
- ld ix,#0
- add ix,sp
-
- ld c,8(ix)
- ld e,9(ix)
+__divuchar_rrx_hds::
+ ld c,l
call .divu8
ld l,c
ld h,b
-
- pop ix
+
ret
-__moduchar_rr_s::
+__moduchar_rrx_s::
ld hl,#2+1
add hl,sp
ld l,(hl)
;; Fall through
-__moduchar_rr_hds::
- push ix
- ld ix,#0
- add ix,sp
-
- ld c,8(ix)
- ld e,9(ix)
+__moduchar_rrx_hds::
+ ld c,l
call .divu8
ld l,e
ld h,d
-
- pop ix
- ret
-__divuint_rr_s::
+ ret
+
+__divuint_rrx_s::
ld hl,#2+3
add hl,sp
ld h,a
;; Fall through
-__divuint_rr_hds::
+__divuint_rrx_hds::
ld b,h
ld c,l
call .divu16
ret
-__moduint_rr_s::
+__moduint_rrx_s::
ld hl,#2+3
add hl,sp
ld h,a
;; Fall through
-__moduint_rr_hds::
+__moduint_rrx_hds::
ld b,h
ld c,l