wok rev 23983

linld: fix strtol
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 24 08:47:45 2020 +0000 (2020-11-24)
parents 9e3f3168b169
children 431c14b76522
files linld/stuff/src/CRTL.ASM linld/stuff/src/ISOCRTL.ASM linld/stuff/src/JUMP.ASM linld/stuff/src/MEMTOP.ASM linld/stuff/src/_BEG.ASM
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Nov 21 13:13:55 2020 +0000
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Tue Nov 24 08:47:45 2020 +0000
     1.3 @@ -17,7 +17,7 @@
     1.4  
     1.5          segment _DATA byte public use16 'DATA'
     1.6  
     1.7 -msg_hang	db      "High mem corrupted",0
     1.8 +msg_hang	db      "Himem broken",0
     1.9  vcpi_alloc_err	db	"VCPI"
    1.10  		global	overflow:byte
    1.11  overflow	db	"/"
    1.12 @@ -1176,7 +1176,7 @@
    1.13  		xchg	ax,cx
    1.14  		;cwd
    1.15  @@goend:
    1.16 -		jmp	@@popdisiret
    1.17 +		jmp	@@end
    1.18  @@notvga:
    1.19  		mov	cl,10			; radix
    1.20  		cmp	al,'-'
    1.21 @@ -1228,21 +1228,19 @@
    1.22  		je	@@shift
    1.23  		mov	cl,30
    1.24  		cmp	al,'g'-'a'+10
    1.25 +@@shift:
    1.26 +		xchg	ax,bx
    1.27  		jne	@@noshift
    1.28 -@@shift:
    1.29 -		rcl	bx,1
    1.30 -		shl	dx,1
    1.31 -		loop	@@shift
    1.32 +		extrn	N_LXLSH@:near
    1.33 +		call	N_LXLSH@
    1.34  @@noshift:
    1.35  		popf
    1.36  		jne	@@end
    1.37  		not	dx
    1.38 -		neg	bx
    1.39 +		neg	ax
    1.40  		jne	@@end
    1.41  		inc	dx
    1.42  @@end:
    1.43 -		xchg	ax,bx
    1.44 -@@popdisiret:
    1.45  		ifndef	USE_ARGSTR
    1.46  		pop	si
    1.47  		endif
    1.48 @@ -1261,7 +1259,7 @@
    1.49          proc	@set_cmdline$qpxzc near
    1.50  		call	openargs
    1.51  		jc	strtol_ret
    1.52 -		mov	cx,4096
    1.53 +		mov	ch,15			; cx<4096
    1.54  		mov	di,[_heap_top]
    1.55  		extrn	read_cmdline:near
    1.56  		jmp	near read_cmdline	; read_cmdline(ax,di,cx)
     2.1 --- a/linld/stuff/src/ISOCRTL.ASM	Sat Nov 21 13:13:55 2020 +0000
     2.2 +++ b/linld/stuff/src/ISOCRTL.ASM	Tue Nov 24 08:47:45 2020 +0000
     2.3 @@ -52,11 +52,9 @@
     2.4  		stosw
     2.5  		mov	al,offset iso_close_hack-0F000h
     2.6  		stosw
     2.7 -;		mov	al,offset iso_cleanup_hack-0F000h
     2.8 -;		stosw
     2.9  		global	@_cpuhaslm$qv:near
    2.10  @_cpuhaslm$qv:
    2.11 -		mov	ax,[132h+3]
    2.12 +		mov	ax,[130h+3]
    2.13  		and	al,20h
    2.14  		ret
    2.15  
    2.16 @@ -263,10 +261,6 @@
    2.17  		sbb	dx,[(word _isostate.fileofs)+2]
    2.18  		ret
    2.19  
    2.20 -;iso_cleanup_hack:
    2.21 -;		mov	ah,3Eh		; close file
    2.22 -;		jmp	dosfd
    2.23 -
    2.24  	ifdef	NO386
    2.25          global  N_LXLSH@ES:near
    2.26  N_LXLSH@ES:
     3.1 --- a/linld/stuff/src/JUMP.ASM	Sat Nov 21 13:13:55 2020 +0000
     3.2 +++ b/linld/stuff/src/JUMP.ASM	Tue Nov 24 08:47:45 2020 +0000
     3.3 @@ -12,16 +12,9 @@
     3.4                  p386
     3.5  		endif
     3.6  
     3.7 -        group   DGROUP  _TEXT,_BSS
     3.8 +        group   DGROUP  _TEXT
     3.9          assume  cs:DGROUP,ds:DGROUP
    3.10  
    3.11 -        segment _BSS byte public use16 'BSS'
    3.12 -
    3.13 -        global  _imgs:dword
    3.14 -
    3.15 -        ends    _BSS
    3.16 -
    3.17 -
    3.18          segment _TEXT byte public use16 'CODE'
    3.19  
    3.20  ;***************************************************************
    3.21 @@ -85,10 +78,6 @@
    3.22  	global	_boot_kernel:near
    3.23          proc    _boot_kernel near
    3.24          
    3.25 -		ifdef	ISOHOOK
    3.26 -		extrn	iso_cleanup_hack:word
    3.27 -		call	[iso_cleanup_hack]	; or ret
    3.28 -		endif
    3.29  		ifdef	NO386
    3.30                  p8086
    3.31  		else
    3.32 @@ -145,6 +134,7 @@
    3.33  		push	dx			; size hi
    3.34  		endif
    3.35  		push	si			; size lo=up to 512k
    3.36 +	        extrn   _imgs:dword
    3.37  		push	[dword _imgs+2]		; src ofs = pm.fallback
    3.38  
    3.39  		;in	al,70h
     4.1 --- a/linld/stuff/src/MEMTOP.ASM	Sat Nov 21 13:13:55 2020 +0000
     4.2 +++ b/linld/stuff/src/MEMTOP.ASM	Tue Nov 24 08:47:45 2020 +0000
     4.3 @@ -12,17 +12,10 @@
     4.4                  p386
     4.5  		endif
     4.6  
     4.7 -        group   DGROUP  _TEXT,_BSS
     4.8 +        group   DGROUP  _TEXT
     4.9          assume  cs:DGROUP,ds:DGROUP
    4.10  
    4.11  
    4.12 -        segment _BSS byte public use16 'BSS'
    4.13 -
    4.14 -saved15		dd	?
    4.15 -
    4.16 -        ends    _BSS
    4.17 -
    4.18 -
    4.19          segment _TEXT byte public use16 'CODE'
    4.20  
    4.21  ;***************************************************************
    4.22 @@ -182,6 +175,7 @@
    4.23                  cmp     al,80h			; 80h = XMS driver installed
    4.24                  je      @@skip
    4.25  		endif
    4.26 +saved15:
    4.27  		xor	bx,bx
    4.28  		mov	es,bx
    4.29  		ifndef	NO386
    4.30 @@ -189,7 +183,7 @@
    4.31  		push	offset int15_88
    4.32  		pop	eax
    4.33  		xchg	eax,[es:bx+15*4]
    4.34 -		mov	[saved15],eax
    4.35 +		mov	[dword saved15],eax
    4.36  		else
    4.37  		mov	ax,offset int15_88
    4.38  		xchg	ax,[es:bx+15*4]
    4.39 @@ -205,10 +199,10 @@
    4.40  int15_88:
    4.41                  cmp     ah,88h
    4.42                  je      @@do88
    4.43 -                jmp     [saved15]
    4.44 +                jmp     [dword saved15]
    4.45  @@do88:
    4.46                  pushf
    4.47 -                call    [saved15]
    4.48 +                call    [dword saved15]
    4.49                  or	ax,ax
    4.50                  jnz     @@iret
    4.51  
     5.1 --- a/linld/stuff/src/_BEG.ASM	Sat Nov 21 13:13:55 2020 +0000
     5.2 +++ b/linld/stuff/src/_BEG.ASM	Tue Nov 24 08:47:45 2020 +0000
     5.3 @@ -115,8 +115,6 @@
     5.4  iso_lseek_hack	dw	@ret
     5.5  		global	iso_close_hack
     5.6  iso_close_hack	dw	@ret
     5.7 -		global	iso_cleanup_hack
     5.8 -iso_cleanup_hack	dw	@ret
     5.9  	        global  _cpu_features:dword
    5.10  _cpu_features	dd	?		; default _cpu_features+3=1Fh/8Eh (bit5=0, not 64bits)
    5.11  		org	$-4