Skip to content

Commit d35f451

Browse files
committed
fixed .L_ typos and patched ___strtoui/_strtoul sections
1 parent b4c5566 commit d35f451

6 files changed

Lines changed: 79 additions & 63 deletions

File tree

src/ce/eval.src

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ _os_EvalVar:
1313
call $20304 ; mov8b
1414
ld hl, ($D02596) ; tmpcnt
1515
push hl
16-
ld hl, .L_os_EvalVar.error
16+
ld hl, _os_EvalVar.error
1717
call $20798 ; push error handler
1818
call $20510 ; findsym
1919
ld a, 141 ; undefined
20-
jr c, .L_os_EvalVar.error
20+
jr c, _os_EvalVar.error
2121
call $20F00 ; parseinp
2222
call $20F30 ; stoans
2323
call $2079C ; pop error handler
2424
xor a, a
25-
.L_os_EvalVar.error:
25+
_os_EvalVar.error:
2626
pop de
2727
push af
2828
call $20E80 ; fixtempcnt
@@ -42,7 +42,7 @@ _os_Eval:
4242
add iy, sp
4343
ld hl, ($D02596) ; tmpcnt
4444
push hl
45-
ld hl, .L_os_Eval.error
45+
ld hl, _os_Eval.error
4646
call $20798 ; push error handler
4747
ld hl, (iy + 3)
4848
push hl
@@ -67,7 +67,7 @@ _os_Eval:
6767
call $20F30 ; stoans
6868
call $2079C ; pop error handler
6969
xor a, a
70-
.L_os_Eval.error:
70+
_os_Eval.error:
7171
pop de
7272
push af
7373
call $20E80 ; fixtempcnt

src/libc/ez80_builtin.src

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ ___ez80_parityi48:
179179
add hl, sp
180180
ld a, (hl)
181181
ld b, 5
182-
.L___ez80_parityi48.loop:
182+
___ez80_parityi48.loop:
183183
inc hl
184184
xor a, (hl)
185-
djnz .L___ez80_parityi48.loop
185+
djnz ___ez80_parityi48.loop
186186
ld a, b
187187
ret pe
188188
dec a
@@ -291,16 +291,16 @@ ___ez80_rotateleft24:
291291
ld hl, (iy + 3)
292292
ld a, (iy + 6)
293293
ld c, 24
294-
.L___ez80_rotateleft24.mod24:
294+
___ez80_rotateleft24.mod24:
295295
sub a, c
296-
jr nc, .L___ez80_rotateleft24.mod24
296+
jr nc, ___ez80_rotateleft24.mod24
297297
add a, c
298298
ret z
299299
ld b, a
300-
.L___ez80_rotateleft24.loop:
300+
___ez80_rotateleft24.loop:
301301
add hl, hl
302302
adc hl, de
303-
djnz .L___ez80_rotateleft24.loop
303+
djnz ___ez80_rotateleft24.loop
304304
ret
305305

306306
;-------------------------------------------------------------------------------
@@ -318,20 +318,20 @@ ___ez80_rotateleft48:
318318
ld de, (iy + 6)
319319
ld a, (iy + 9)
320320
ld c, 48
321-
.L___ez80_rotateleft48.mod48:
321+
___ez80_rotateleft48.mod48:
322322
sub a, c
323-
jr nc, .L___ez80_rotateleft48.mod48
323+
jr nc, ___ez80_rotateleft48.mod48
324324
add a, c
325325
ret z
326326
ld c, 0
327-
.L___ez80_rotateleft48.loop:
327+
___ez80_rotateleft48.loop:
328328
add hl, hl
329329
ex de, hl
330330
adc hl, hl
331331
ex de, hl
332332
adc hl, bc
333333
dec a
334-
jr nz, .L___ez80_rotateleft48.loop
334+
jr nz, ___ez80_rotateleft48.loop
335335
ret
336336

337337
;-------------------------------------------------------------------------------
@@ -348,17 +348,17 @@ ___ez80_rotateright24:
348348
ld hl, (iy + 3)
349349
ld a, (iy + 6)
350350
ld c, 24
351-
.L___ez80_rotateright24.mod24:
351+
___ez80_rotateright24.mod24:
352352
sub a, c
353-
jr nc, .L___ez80_rotateright24.mod24
353+
jr nc, ___ez80_rotateright24.mod24
354354
neg
355355
cp a, c
356356
ret z
357357
ld b, a
358-
.L___ez80_rotateright24.loop:
358+
___ez80_rotateright24.loop:
359359
add hl, hl
360360
adc hl, de
361-
djnz .L___ez80_rotateright24.loop
361+
djnz ___ez80_rotateright24.loop
362362
ret
363363

364364
;-------------------------------------------------------------------------------
@@ -376,21 +376,21 @@ ___ez80_rotateright48:
376376
ld de, (iy + 6)
377377
ld a, (iy + 9)
378378
ld c, 48
379-
.L___ez80_rotateright48.mod48:
379+
___ez80_rotateright48.mod48:
380380
sub a, c
381-
jr nc, .L___ez80_rotateright48.mod48
381+
jr nc, ___ez80_rotateright48.mod48
382382
neg
383383
cp a, c
384384
ret z
385385
ld c, 0
386-
.L___ez80_rotateright48.loop:
386+
___ez80_rotateright48.loop:
387387
add hl, hl
388388
ex de, hl
389389
adc hl, hl
390390
ex de, hl
391391
adc hl, bc
392392
dec a
393-
jr nz, .L___ez80_rotateright48.loop
393+
jr nz, ___ez80_rotateright48.loop
394394
ret
395395

396396
;-------------------------------------------------------------------------------

src/libc/fminmaxf.src

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616
.type _fminf, @function
1717
.global _fmin
1818
.type _fmin, @function
19-
.global _fmaxf
20-
.type _fmaxf, @function
21-
.global _fmax
22-
.type _fmax, @function
2319

24-
_fminf:
2520
_fmin:
21+
_fminf:
2622
ld iy, 0
2723
add iy, sp
2824
ld bc, $010000
@@ -38,20 +34,20 @@ _fmin:
3834
; (X-, Y-): A = 0 NC Z ; invert compare
3935
; (X-, Y+): A = -1 C NZ ; X < Y
4036
; (X+, Y-): A = +1 NC NZ ; X > Y
41-
jr nz, .L_fmin.different_sign
42-
; .L_fmin.same_sign:
37+
jr nz, _fminf.different_sign
38+
; _fminf.same_sign:
4339
sbc hl, de ; X - Y
4440
add hl, de
45-
jr nz, .L_fmin.x_and_y_diff
41+
jr nz, _fminf.x_and_y_diff
4642
ld a, (iy + 3)
4743
cp a, (iy + 9)
48-
.L_fmin.x_and_y_diff:
44+
_fminf.x_and_y_diff:
4945
sbc a, a
5046
xor a, (iy + 6) ; invert the comparison
5147
add a, a
52-
.L_fmin.different_sign:
48+
_fminf.different_sign:
5349
jr c, _fminmaxf_common.no_swap
54-
; .L_fmin.swap:
50+
; _fminf.swap:
5551
ex de, hl
5652
add hl, bc ; overflows for NaN and Inf
5753
jr c, _fminmaxf_common.y_maybe_NaN
@@ -100,8 +96,8 @@ _fminmaxf_common.x_maybe_NaN:
10096
.global _fmax
10197
.type _fmax, @function
10298

103-
_fmaxf:
10499
_fmax:
100+
_fmaxf:
105101
ld iy, 0
106102
add iy, sp
107103
ld bc, $010000
@@ -117,24 +113,24 @@ _fmax:
117113
; (X-, Y-): A = 0 NC Z ; invert compare
118114
; (X-, Y+): A = -1 C NZ ; X < Y
119115
; (X+, Y-): A = +1 NC NZ ; X > Y
120-
jr nz, .L_fmax.different_sign
121-
; .L_fmax.same_sign:
116+
jr nz, _fmaxf.different_sign
117+
; _fmaxf.same_sign:
122118
sbc hl, de ; X - Y
123119
add hl, de
124-
jr nz, .L_fmax.x_and_y_diff
120+
jr nz, _fmaxf.x_and_y_diff
125121
ld a, (iy + 3)
126122
cp a, (iy + 9)
127-
.L_fmax.x_and_y_diff:
123+
_fmaxf.x_and_y_diff:
128124
sbc a, a
129125
xor a, (iy + 6) ; invert the comparison
130126
add a, a
131-
.L_fmax.different_sign:
127+
_fmaxf.different_sign:
132128
jr nc, _fminmaxf_common.no_swap
133-
; .L_fmax.swap:
129+
; _fmaxf.swap:
134130
ex de, hl
135131
add hl, bc ; overflows for NaN and Inf
136132
jr c, _fminmaxf_common.y_maybe_NaN
137-
.L_fmax.return_y:
133+
_fmaxf.return_y:
138134
ld hl, (iy + 9)
139135
ld e, (iy + 12)
140136
ret

src/libc/memmem.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ _memcmp_fast:
7070
; Z = match
7171
; NZ = no match
7272
ld bc, (iy + needle_len)
73-
.L_memcmp_fast.loop:
73+
.L.cmp_loop:
7474
cpi
7575
ret po
7676
inc de
7777
ld a, (de)
78-
jr z, .L_memcmp_fast.loop
78+
jr z, .L.cmp_loop
7979
ret

src/libc/memrmem.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ _memrcmp_fast:
8888
; NZ = no match
8989
inc hl
9090
ld bc, (iy + needle_len)
91-
.L_memrcmp_fast.loop:
91+
.L.cmp_loop:
9292
cpd
9393
ret po
9494
dec de
9595
ld a, (de)
96-
jr z, .L_memrcmp_fast.loop
96+
jr z, .L.cmp_loop
9797
ret

src/libc/strtol.src

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.assume adl=1
22

3+
; until we figure out how to get FASMG require or etc working correctly
4+
.equ HAVE_WE_FIGURED_OUT_BINUTILS_YET, 0
5+
36
;-------------------------------------------------------------------------------
47

58
.section .text.___strtoi
@@ -9,7 +12,7 @@
912

1013
___strtoi:
1114
; Similar to strtol, except that it will raise ERANGE and return INT_MIN/INT_MAX when out of range
12-
call .L__strtol_common
15+
call __strtol_common
1316
; overflow occured if B is non-zero
1417
djnz .L.out_of_range
1518
inc e
@@ -44,30 +47,30 @@ ___strtoi:
4447
.type _strtol, @function
4548

4649
_strtol:
47-
call .L__strtol_common
50+
call __strtol_common
4851
; overflow occured if B is non-zero
49-
djnz .L_strtol.out_of_range
52+
djnz _strtol.out_of_range
5053
ld a, e
5154
rla
52-
jr c, .L_strtol.maybe_out_of_range
55+
jr c, _strtol.maybe_out_of_range
5356
ret nz
5457
jp __lneg
5558

56-
.L_strtol.maybe_out_of_range:
59+
_strtol.maybe_out_of_range:
5760
; greater than INT_MAX
58-
jr nz, .L_strtol.overflow
61+
jr nz, _strtol.overflow
5962
; negative
6063
; check that the result is not an exact INT_MIN
6164
or a, a
6265
adc hl, hl
63-
jr nz, .L_strtol.underflow
66+
jr nz, _strtol.underflow
6467
ld a, e
6568
adc a, a
6669
ret z ; exact INT_MIN
67-
.L_strtol.underflow:
70+
_strtol.underflow:
6871
xor a, a ; set Z
69-
.L_strtol.out_of_range:
70-
.L_strtol.overflow:
72+
_strtol.out_of_range:
73+
_strtol.overflow:
7174
ld e, $80
7275
ld hl, 5 ; ERANGE
7376
ld (_errno), hl
@@ -87,14 +90,20 @@ _strtol:
8790

8891
___strtoui:
8992
; Similar to strtoul, except that it will raise ERANGE and return UINT_MAX when out of range
90-
call .L__strtol_common
93+
call __strtol_common
9194
; overflow occured if B is non-zero
92-
djnz .L_strtoui.out_of_range
95+
djnz _strtoul.out_of_range
9396
call z, __ineg
9497
inc e
9598
dec e
9699
ret z
97-
.L_strtoui.out_of_range:
100+
101+
.if HAVE_WE_FIGURED_OUT_BINUTILS_YET
102+
.section .text._strtoul.out_of_range
103+
104+
.local _strtoul.out_of_range
105+
_strtoul.out_of_range:
106+
.endif
98107
ld hl, 5 ; ERANGE
99108
ld (_errno), hl
100109
ld l, h ; ld hl, 0
@@ -107,19 +116,30 @@ ___strtoui:
107116
.global _strtoul
108117
.type _strtoul, @function
109118
_strtoul:
110-
call .L__strtol_common
119+
call __strtol_common
111120
; overflow occured if B is non-zero
112-
djnz .L_strtoui.out_of_range
121+
djnz _strtoul.out_of_range
113122
ret nz
114123
jp __lneg
115124

125+
.if HAVE_WE_FIGURED_OUT_BINUTILS_YET
126+
.else
127+
_strtoul.out_of_range:
128+
ld hl, 5 ; ERANGE
129+
ld (_errno), hl
130+
ld l, h ; ld hl, 0
131+
dec hl
132+
ld e, l
133+
ret
134+
.endif
135+
116136
;-------------------------------------------------------------------------------
117137

118138
.section .text.__strtol_common
119139

120-
.local .L__strtol_common
140+
.local __strtol_common
121141

122-
.L__strtol_common:
142+
__strtol_common:
123143
; output: E:UHL
124144
; B = 1 if no overflow
125145
; Z means that A is zero = negate return value

0 commit comments

Comments
 (0)