Skip to content

Commit ce6a219

Browse files
ZERICO2005mateoconlechuga
authored andcommitted
Preserved D and UDE in 64bit input, 32bit output CRT routines
1 parent fe31098 commit ce6a219

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

src/crt/dtof.src

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ __dtof:
88
; f64_ret_f32
99
push af, iy, bc, de, hl
1010
call _f64_to_f32
11-
pop af, af, af, iy, af
11+
pop af
12+
ld a, e
13+
pop de
14+
ld e, a
15+
pop bc, iy, af
1216
ret
1317

1418
extern _f64_to_f32

src/crt/dtol.src

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ __dtol:
1616
rlca
1717
ld (hl), a ; store the sign of x in the padding byte
1818
call __dtol_c
19-
pop af, af, bc, iy, af
19+
pop af
20+
ld a, e
21+
pop de
22+
ld e, a
23+
pop bc, iy, af
2024
ret
2125

2226
extern __dtol_c

src/crt/dtoul.src

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ __dtoul:
88
; f64_ret_u32
99
push af, iy, bc, de, hl
1010
call __dtoul_c
11-
pop af, af, bc, iy, af
11+
pop af
12+
ld a, e
13+
pop de
14+
ld e, a
15+
pop bc, iy, af
1216
ret
1317

1418
extern __dtoul_c

src/crt/lltof.src

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
__lltof:
66
push af, iy, bc, de, hl
77
call __lltof_c
8-
pop af, af, af, iy, af
8+
pop af
9+
ld a, e
10+
pop de
11+
ld e, a
12+
pop bc, iy, af
913
ret
1014

1115
extern __lltof_c

src/crt/ulltof.src

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
__ulltof:
66
push af, iy, bc, de, hl
77
call __ulltof_c
8-
pop af, af, af, iy, af
8+
pop af
9+
ld a, e
10+
pop de
11+
ld e, a
12+
pop bc, iy, af
913
ret
1014

1115
extern __ulltof_c

0 commit comments

Comments
 (0)