wok-6.x rev 24164

linld: fix vcpi case
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 26 17:19:46 2021 +0000 (2021-12-26)
parents 1523c0330556
children 82053bab32c1
files linld/stuff/src/CRTL.ASM linld/stuff/src/VCPI.ASM linld/stuff/src/_BEG.ASM syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Dec 25 15:56:57 2021 +0000
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Sun Dec 26 17:19:46 2021 +0000
     1.3 @@ -88,13 +88,17 @@
     1.4  		stc
     1.5                  int	21h
     1.6  		pop	si dx
     1.7 +		ifdef ISO9660
     1.8                  jnc	@@openok
     1.9 +		else
    1.10 +                jnc	dosret
    1.11 +		endif
    1.12  	else
    1.13                  mov	dx,bx			; open(DS:DX=filename,al=access,cl=attributes)
    1.14  	endif
    1.15                  mov	ax,3d00h		; read-only+compatibility
    1.16 +	ifdef ISO9660
    1.17  		call	dos
    1.18 -	ifdef ISO9660
    1.19  		jc	@@openret
    1.20  @@openok:
    1.21  		xchg	ax,bx
    1.22 @@ -108,12 +112,12 @@
    1.23  		;xor	cx,cx
    1.24  		cwd
    1.25  		call	seeksetpos0		; filepos = 0
    1.26 -	else
    1.27 -@@openok:
    1.28 -	endif
    1.29  		xchg	ax,bx			; fd
    1.30  @@openret:
    1.31  		ret
    1.32 +	else
    1.33 +		jmp	dos
    1.34 +	endif
    1.35  
    1.36  	ifdef ISO9660
    1.37  
    1.38 @@ -161,7 +165,7 @@
    1.39  
    1.40          global  close:near			; close(ax)
    1.41  close:
    1.42 -		mov	bh,3Eh			; close(BX:handle)
    1.43 +		mov	bh,3Eh			; close(AX:handle)
    1.44  	ifdef ISO9660
    1.45  		mov	cx,[_isostate.fd]
    1.46  		jcxz	dosbx
    1.47 @@ -215,12 +219,12 @@
    1.48                  ;jcxz	fail
    1.49  dos:
    1.50                  int	21h
    1.51 -                jnc	@@doret
    1.52 +                jnc	dosret
    1.53  fail:
    1.54  		stc
    1.55  failifc:
    1.56                  sbb	ax,ax			; ax=-1 CF
    1.57 -@@doret:
    1.58 +dosret:
    1.59                  ret
    1.60  
    1.61          endp    @read$qipvi
    1.62 @@ -301,7 +305,9 @@
    1.63  		mov	bh,42h			; bx=fd cx:dx=offset al=whence
    1.64  dosbx:
    1.65  		xchg	ax,bx
    1.66 -		jmp	dos			; bx = fd
    1.67 +		or	bx,bx
    1.68 +		jne	dos			; bx = fd
    1.69 +		ret
    1.70  
    1.71  	endp	@isolseek$qpxul
    1.72  
    1.73 @@ -392,6 +398,33 @@
    1.74  	endif
    1.75  
    1.76  ;***************************************************************
    1.77 +;_fastcall void puts(bx:const char* s):
    1.78 +;***************************************************************
    1.79 +        global  @puts$qpxzc:near
    1.80 +
    1.81 +;        global  puts:near			; puts(bx)
    1.82 +@putsz:
    1.83 +		call	@putc
    1.84 +@puts$qpxzc:
    1.85 +puts:
    1.86 +		mov	dl,[bx]
    1.87 +		inc	bx
    1.88 +		or	dl,dl
    1.89 +		jne	@putsz
    1.90 +		mov	dl,10
    1.91 +@putc:
    1.92 +		cmp	dl,10
    1.93 +		jne	@putcz
    1.94 +		call	@putcz2
    1.95 +@putcz2:
    1.96 +		xor	dl,7		; 10^13  1010^1101
    1.97 +@putcz:
    1.98 +		mov	ah,2
    1.99 +do_int21h:
   1.100 +		int	21h
   1.101 +		ret
   1.102 +
   1.103 +;***************************************************************
   1.104  ;_fastcall char* malloc_or_die(ax:unsigned size);
   1.105  ;***************************************************************
   1.106  xchg_heap_top:
   1.107 @@ -439,31 +472,33 @@
   1.108  	endp	@die$qpxzc
   1.109  
   1.110  ;***************************************************************
   1.111 -;_fastcall void puts(bx:const char* s):
   1.112 +;_fastcall void open_image(si:struct image_himem *m, ax:const char *name);
   1.113  ;***************************************************************
   1.114 -        global  @puts$qpxzc:near
   1.115  
   1.116 -;        global  puts:near			; puts(bx)
   1.117 -@putsz:
   1.118 -		call	@putc
   1.119 -@puts$qpxzc:
   1.120 -puts:
   1.121 -		mov	dl,[bx]
   1.122 -		inc	bx
   1.123 -		or	dl,dl
   1.124 -		jne	@putsz
   1.125 -		mov	dl,10
   1.126 -@putc:
   1.127 -		cmp	dl,10
   1.128 -		jne	@putcz
   1.129 -		call	@putcz2
   1.130 -@putcz2:
   1.131 -		xor	dl,7		; 10^13  1010^1101
   1.132 -@putcz:
   1.133 -		mov	ah,2
   1.134 -do_int21h:
   1.135 -		int	21h
   1.136 -		ret
   1.137 +        global  @open_image$qp11image_himempxzc:near
   1.138 +        proc    @open_image$qp11image_himempxzc near
   1.139 +
   1.140 +                mov	[(image_himem si).state],ax
   1.141 +		push	ax
   1.142 +@@next:
   1.143 +		call	next_chunk
   1.144 +		ifndef	NO386
   1.145 +		add	eax,3
   1.146 +		and	al,0FCh
   1.147 +		add	[(image_himem si).size],eax	; m->size += m->chunk_size	size zero'd in bss
   1.148 +		or	eax,eax
   1.149 +		else
   1.150 +		add	ax,3
   1.151 +		adc	dx,0
   1.152 +		and	al,0FCh
   1.153 +		add	[word (image_himem si).size],ax	; m->size += m->chunk_size	size zero'd in bss
   1.154 +		adc	[word ((image_himem si).size)+2],dx
   1.155 +		or	ax,dx
   1.156 +		endif
   1.157 +		jnz	@@next
   1.158 +                pop	[(image_himem si).state]
   1.159 +
   1.160 +        endp    @open_image$qp11image_himempxzc
   1.161  
   1.162  ;***************************************************************
   1.163  ;static long next_chunk(struct image_himem *si);
   1.164 @@ -647,286 +682,6 @@
   1.165  
   1.166  ;===============================================================
   1.167  
   1.168 -;***************************************************************
   1.169 -;_fastcall void open_image(si:struct image_himem *m, ax:const char *name);
   1.170 -;***************************************************************
   1.171 -
   1.172 -        global  @open_image$qp11image_himempxzc:near
   1.173 -        proc    @open_image$qp11image_himempxzc near
   1.174 -
   1.175 -                mov	[(image_himem si).state],ax
   1.176 -		push	ax
   1.177 -@@next:
   1.178 -		call	next_chunk
   1.179 -		ifndef	NO386
   1.180 -		add	eax,3
   1.181 -		and	al,0FCh
   1.182 -		add	[(image_himem si).size],eax	; m->size += m->chunk_size	size zero'd in bss
   1.183 -		or	eax,eax
   1.184 -		else
   1.185 -		add	ax,3
   1.186 -		adc	dx,0
   1.187 -		and	al,0FCh
   1.188 -		add	[word (image_himem si).size],ax	; m->size += m->chunk_size	size zero'd in bss
   1.189 -		adc	[word ((image_himem si).size)+2],dx
   1.190 -		or	ax,dx
   1.191 -		endif
   1.192 -		jnz	@@next
   1.193 -                pop	[(image_himem si).state]
   1.194 -
   1.195 -        endp    @open_image$qp11image_himempxzc
   1.196 -
   1.197 -;===============================================================
   1.198 -
   1.199 -;***************************************************************
   1.200 -;_fastcall int read_image(si:struct image_himem *m);
   1.201 -;***************************************************************
   1.202 -        global  @read_image$qp11image_himem:near
   1.203 -        proc    @read_image$qp11image_himem near
   1.204 -
   1.205 -		push	di
   1.206 -		xor	di,di
   1.207 -@@loop:
   1.208 -		ifndef	NO386
   1.209 -		xor	ecx,ecx
   1.210 -		mov	ch,4096/256
   1.211 -		sub	cx,di
   1.212 -		mov	eax,[(image_himem si).chunk_size]
   1.213 -		cmp	ecx,eax
   1.214 -		jb	@@szok
   1.215 -		else
   1.216 -		mov	cx,4096
   1.217 -		sub	cx,di
   1.218 -		mov	ax,[word (image_himem si).chunk_size]
   1.219 -		cmp	cx,ax
   1.220 -		jb	@@szok
   1.221 -		cmp	[word ((image_himem si).chunk_size)+2],0	; hi m->chunk_size
   1.222 -		jne	@@szok
   1.223 -		endif
   1.224 -		xchg	ax,cx
   1.225 -@@szok:
   1.226 -		jcxz	@@image_done
   1.227 -		lea	dx,[di+_buf4k]
   1.228 -		mov	bx,[(image_himem si).fd]
   1.229 -		call	@read$cxdxbx
   1.230 -		jb	@@image_done
   1.231 -		add	di,ax
   1.232 -		ifndef	NO386
   1.233 -		cwde				; ax < 8000h
   1.234 -		cdq
   1.235 -		sub	[(image_himem si).chunk_size],eax
   1.236 -		else
   1.237 -		cwd				; ax < 8000h
   1.238 -		sub	[word (image_himem si).chunk_size],ax
   1.239 -		sbb	[word ((image_himem si).chunk_size)+2],dx
   1.240 -		endif
   1.241 -@@fill:
   1.242 -		test	al,3
   1.243 -		je	@@filled
   1.244 -		mov	[di+_buf4k],dl
   1.245 -		inc	di
   1.246 -		inc	ax
   1.247 -		jmp	@@fill
   1.248 -@@filled:
   1.249 -		ifndef	NO386
   1.250 -		sub	[(image_himem si).remaining],eax
   1.251 -		or	edx,[word (image_himem si).chunk_size]
   1.252 -		else
   1.253 -		sub	[word (image_himem si).remaining],ax
   1.254 -		sbb	[word ((image_himem si).remaining)+2],dx
   1.255 -		mov	ax,[word (image_himem si).chunk_size]
   1.256 -		or	ax,[word ((image_himem si).chunk_size)+2]
   1.257 -		endif
   1.258 -		jnz	@@same_chunk
   1.259 -		call	next_chunk
   1.260 -@@same_chunk:
   1.261 -		jmp	@@loop
   1.262 -@@image_done:
   1.263 -		xchg	ax,di
   1.264 -                pop	di
   1.265 -		ret
   1.266 -
   1.267 -        endp    @read_image$qp11image_himem
   1.268 -
   1.269 -;===============================================================
   1.270 -
   1.271 -;***************************************************************
   1.272 -;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
   1.273 -;_fastcall unsigned long *argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var);
   1.274 -;***************************************************************
   1.275 -	global	@argstr$qpxzcxt1ppxzc:near
   1.276 -	proc	@argstr$qpxzcxt1ppxzc near
   1.277 -
   1.278 -		mov	cl,2
   1.279 -		db	0a9h			; test	ax,#
   1.280 -	global	@argnum$qpzcxpxzcpul:near
   1.281 -@argnum$qpzcxpxzcpul:
   1.282 -		mov	cl,4
   1.283 -		push	bx
   1.284 -		xchg	ax,bx			; keywords -> bx
   1.285 -		xchg	ax,cx			; s -> cx
   1.286 -		cbw				; argstr:0002 argnum:0004
   1.287 -		xchg	ax,dx			; vars -> ax
   1.288 -		push	si di
   1.289 -		xchg	ax,di			; vars => di
   1.290 -		dec	bx
   1.291 -		sub	di,dx
   1.292 -@@loop:
   1.293 -		add	di,dx
   1.294 -		mov	si,cx			; s
   1.295 -@@match:
   1.296 -		lodsb				; *s++
   1.297 -		or	al,20h			; locase
   1.298 -		cmp	al,'/'			; 2f
   1.299 -		jne	@@notopt
   1.300 -		mov	al,'-'
   1.301 -@@notopt:
   1.302 -		inc	bx			; keywords++
   1.303 -		cmp	al,[bx]
   1.304 -		je	@@match
   1.305 -		cmp	[byte bx],dh
   1.306 -		je	@@lastal
   1.307 -		cmp	[byte bx],'|'
   1.308 -		je	@@testal
   1.309 -		jl	@@notsw			; } ~ <del>
   1.310 -		;mov	dl,1
   1.311 -		cmp	al,20h			; EOS or 20h
   1.312 -		jne	@@loop			; assume [bx] = '|'
   1.313 -@@notsw:
   1.314 -		mov	al,-1
   1.315 -		jne	@@notopt
   1.316 -		jmp	@@setnum2
   1.317 -@@testal:
   1.318 -		cmp	al,-1
   1.319 -		jz	@@loop
   1.320 -@@lastal:
   1.321 -		cmp	al,'='
   1.322 -		xchg	ax,cx			; return s if failure
   1.323 -		jne	@@nokeyword
   1.324 -		dec	dx
   1.325 -		dec	dx
   1.326 -		je	@@done
   1.327 -@strtol$qpxzc:
   1.328 -		ifndef	NO386
   1.329 -		xor	ecx,ecx
   1.330 -		xor	ebx,ebx
   1.331 -		else
   1.332 -		xor	bx,bx
   1.333 -		xor	cx,cx
   1.334 -		xor	dx,dx
   1.335 -		endif
   1.336 -		lodsb
   1.337 -		or	al,20h
   1.338 -		cmp	al,'a'
   1.339 -		jb	@@notvga
   1.340 -		sub	al,'o'
   1.341 -@@vgaloop:
   1.342 -		dec	cx
   1.343 -		add	al,6
   1.344 -		jnb	@@vgaloop		; vga=normal,extended,ask
   1.345 -@@vga:
   1.346 -		xchg	ax,cx
   1.347 -		;cwd
   1.348 -		jmp	@@end
   1.349 -@@endstrtol:
   1.350 -		mov	cl,10
   1.351 -		cmp	al,'k'-'a'+10
   1.352 -		je	@@shift
   1.353 -		mov	cl,20
   1.354 -		cmp	al,'m'-'a'+10
   1.355 -		je	@@shift
   1.356 -		mov	cl,30
   1.357 -		cmp	al,'g'-'a'+10
   1.358 -		ifndef	NO386
   1.359 -		jne	@@noshift
   1.360 -@@shift:
   1.361 -		shl	ebx,cl
   1.362 -@@noshift:
   1.363 -		popf
   1.364 -		jnc	@@end2
   1.365 -		neg	ebx
   1.366 -@@end2:
   1.367 -		push	ebx
   1.368 -		pop	ax
   1.369 -		pop	dx
   1.370 -		else
   1.371 -@@shift:
   1.372 -		xchg	ax,bx
   1.373 -		jne	@@noshift
   1.374 -		extrn	N_LXLSH@:near
   1.375 -		call	N_LXLSH@
   1.376 -@@noshift:
   1.377 -		popf
   1.378 -		jne	@@end
   1.379 -		not	dx
   1.380 -		neg	ax
   1.381 -		jne	@@end
   1.382 -		inc	dx
   1.383 -		endif
   1.384 -@@end:
   1.385 -@@setnum:
   1.386 -		mov	[di+2],dx
   1.387 -@@setnum2:
   1.388 -		xchg	ax,si
   1.389 -@@done:
   1.390 -		or	[di],si
   1.391 -		xchg	ax,di
   1.392 -@@nokeyword:
   1.393 -		pop	di si bx
   1.394 -		ret
   1.395 -
   1.396 -@@notvga:
   1.397 -		mov	cl,10			; radix
   1.398 -		cmp	al,'-'
   1.399 -		jne	@@radixkeep
   1.400 -		lodsb
   1.401 -@@radixkeep:
   1.402 -		pushf
   1.403 -		cmp	al,'0'
   1.404 -		jne	@@radixok
   1.405 -		mov	cl,8
   1.406 -		lodsb
   1.407 -		or	al,20h
   1.408 -		cmp	al,'x'
   1.409 -		jne	@@radixok
   1.410 -		mov	cl,16
   1.411 -@@strtollp:
   1.412 -		lodsb
   1.413 -@@radixok:
   1.414 -		or	al,20h
   1.415 -		sub	al,'0'
   1.416 -		jb	@@endstrtol
   1.417 -		cmp	al,9
   1.418 -		jbe	@@digitok
   1.419 -		cmp	al,'a'-'0'
   1.420 -		jb	@@endstrtol
   1.421 -		sub	al,'a'-'0'-10
   1.422 -@@digitok:
   1.423 -		cmp	al,cl
   1.424 -		jae	@@endstrtol
   1.425 -		cbw
   1.426 -		ifndef	NO386
   1.427 -		cwde
   1.428 -		xchg	eax,ebx
   1.429 -		mul	ecx
   1.430 -		add	ebx,eax
   1.431 -		else
   1.432 -		push	ax
   1.433 -		xchg	ax,dx
   1.434 -		mul	cx
   1.435 -		xchg	ax,bx
   1.436 -		mul	cx
   1.437 -		add	dx,bx
   1.438 -		pop	bx
   1.439 -		add	bx,ax
   1.440 -		adc	dx,0
   1.441 -		endif
   1.442 -		jmp	@@strtollp
   1.443 -
   1.444 -	endp	@argstr$qpxzcxt1ppxzc
   1.445 -
   1.446 -;===============================================================
   1.447 -
   1.448  		ifdef	VCPI
   1.449                  p386
   1.450  ;***************************************************************
   1.451 @@ -1105,6 +860,256 @@
   1.452  
   1.453          endp	@strcatb$qpxzct1
   1.454  
   1.455 +;***************************************************************
   1.456 +;_fastcall int read_image(si:struct image_himem *m);
   1.457 +;***************************************************************
   1.458 +        global  @read_image$qp11image_himem:near
   1.459 +        proc    @read_image$qp11image_himem near
   1.460 +
   1.461 +		push	di
   1.462 +		xor	di,di
   1.463 +@@loop:
   1.464 +		ifndef	NO386
   1.465 +		xor	ecx,ecx
   1.466 +		mov	ch,4096/256
   1.467 +		sub	cx,di
   1.468 +		mov	eax,[(image_himem si).chunk_size]
   1.469 +		cmp	ecx,eax
   1.470 +		jb	@@szok
   1.471 +		else
   1.472 +		mov	cx,4096
   1.473 +		sub	cx,di
   1.474 +		mov	ax,[word (image_himem si).chunk_size]
   1.475 +		cmp	cx,ax
   1.476 +		jb	@@szok
   1.477 +		cmp	[word ((image_himem si).chunk_size)+2],0	; hi m->chunk_size
   1.478 +		jne	@@szok
   1.479 +		endif
   1.480 +		xchg	ax,cx
   1.481 +@@szok:
   1.482 +		jcxz	@@image_done
   1.483 +		lea	dx,[di+_buf4k]
   1.484 +		mov	bx,[(image_himem si).fd]
   1.485 +		call	@read$cxdxbx
   1.486 +		jb	@@image_done
   1.487 +		add	di,ax
   1.488 +		ifndef	NO386
   1.489 +		cwde				; ax < 8000h
   1.490 +		cdq
   1.491 +		sub	[(image_himem si).chunk_size],eax
   1.492 +		else
   1.493 +		cwd				; ax < 8000h
   1.494 +		sub	[word (image_himem si).chunk_size],ax
   1.495 +		sbb	[word ((image_himem si).chunk_size)+2],dx
   1.496 +		endif
   1.497 +@@fill:
   1.498 +		test	al,3
   1.499 +		je	@@filled
   1.500 +		mov	[di+_buf4k],dl
   1.501 +		inc	di
   1.502 +		inc	ax
   1.503 +		jmp	@@fill
   1.504 +@@filled:
   1.505 +		ifndef	NO386
   1.506 +		sub	[(image_himem si).remaining],eax
   1.507 +		or	edx,[word (image_himem si).chunk_size]
   1.508 +		else
   1.509 +		sub	[word (image_himem si).remaining],ax
   1.510 +		sbb	[word ((image_himem si).remaining)+2],dx
   1.511 +		mov	ax,[word (image_himem si).chunk_size]
   1.512 +		or	ax,[word ((image_himem si).chunk_size)+2]
   1.513 +		endif
   1.514 +		jnz	@@same_chunk
   1.515 +		call	next_chunk
   1.516 +@@same_chunk:
   1.517 +		jmp	@@loop
   1.518 +@@image_done:
   1.519 +		xchg	ax,di
   1.520 +                pop	di
   1.521 +		ret
   1.522 +
   1.523 +        endp    @read_image$qp11image_himem
   1.524 +
   1.525 +;===============================================================
   1.526 +
   1.527 +;***************************************************************
   1.528 +;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
   1.529 +;_fastcall unsigned long *argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var);
   1.530 +;***************************************************************
   1.531 +	global	@argstr$qpxzcxt1ppxzc:near
   1.532 +	proc	@argstr$qpxzcxt1ppxzc near
   1.533 +
   1.534 +		mov	cl,2
   1.535 +		db	0a9h			; test	ax,#
   1.536 +	global	@argnum$qpzcxpxzcpul:near
   1.537 +@argnum$qpzcxpxzcpul:
   1.538 +		mov	cl,4
   1.539 +		push	bx
   1.540 +		xchg	ax,bx			; keywords -> bx
   1.541 +		xchg	ax,cx			; s -> cx
   1.542 +		cbw				; argstr:0002 argnum:0004
   1.543 +		xchg	ax,dx			; vars -> ax
   1.544 +		push	si di
   1.545 +		xchg	ax,di			; vars => di
   1.546 +		dec	bx
   1.547 +		sub	di,dx
   1.548 +@@loop:
   1.549 +		add	di,dx
   1.550 +		mov	si,cx			; s
   1.551 +@@match:
   1.552 +		lodsb				; *s++
   1.553 +		or	al,20h			; locase
   1.554 +		;ifdef	DOS_SWITCH
   1.555 +		cmp	al,'/'			; 2f
   1.556 +		jne	@@notopt
   1.557 +		mov	al,'-'
   1.558 +@@notopt:
   1.559 +		;endif
   1.560 +		inc	bx			; keywords++
   1.561 +		cmp	al,[bx]
   1.562 +		je	@@match
   1.563 +		cmp	[byte bx],dh
   1.564 +		je	@@lastal
   1.565 +		cmp	[byte bx],'|'
   1.566 +		je	@@testal
   1.567 +		jl	@@notsw			; } ~ <del>
   1.568 +		;mov	dl,1
   1.569 +		cmp	al,20h			; EOS or 20h
   1.570 +		jne	@@loop			; assume [bx] = '|'
   1.571 +@@notsw:
   1.572 +		mov	al,-1
   1.573 +		jne	@@notopt
   1.574 +		jmp	@@setnum2
   1.575 +@@testal:
   1.576 +		cmp	al,-1
   1.577 +		jz	@@loop
   1.578 +@@lastal:
   1.579 +		cmp	al,'='
   1.580 +		xchg	ax,cx			; return s if failure
   1.581 +		jne	@@nokeyword
   1.582 +		dec	dx
   1.583 +		dec	dx
   1.584 +		je	@@done
   1.585 +@strtol$qpxzc:
   1.586 +		ifndef	NO386
   1.587 +		xor	ecx,ecx
   1.588 +		xor	ebx,ebx
   1.589 +		else
   1.590 +		xor	bx,bx
   1.591 +		xor	cx,cx
   1.592 +		xor	dx,dx
   1.593 +		endif
   1.594 +		lodsb
   1.595 +		or	al,20h
   1.596 +		cmp	al,'a'
   1.597 +		jb	@@notvga
   1.598 +		sub	al,'o'
   1.599 +@@vgaloop:
   1.600 +		dec	cx
   1.601 +		add	al,6
   1.602 +		jnb	@@vgaloop		; vga=normal,extended,ask
   1.603 +@@vga:
   1.604 +		xchg	ax,cx
   1.605 +		;cwd
   1.606 +		jmp	@@end
   1.607 +@@endstrtol:
   1.608 +		mov	cl,10
   1.609 +		cmp	al,'k'-'a'+10
   1.610 +		je	@@shift
   1.611 +		mov	cl,20
   1.612 +		cmp	al,'m'-'a'+10
   1.613 +		je	@@shift
   1.614 +		mov	cl,30
   1.615 +		cmp	al,'g'-'a'+10
   1.616 +		ifndef	NO386
   1.617 +		jne	@@noshift
   1.618 +@@shift:
   1.619 +		shl	ebx,cl
   1.620 +@@noshift:
   1.621 +		popf
   1.622 +		jnc	@@end2
   1.623 +		neg	ebx
   1.624 +@@end2:
   1.625 +		push	ebx
   1.626 +		pop	ax
   1.627 +		pop	dx
   1.628 +		else
   1.629 +@@shift:
   1.630 +		xchg	ax,bx
   1.631 +		jne	@@noshift
   1.632 +		extrn	N_LXLSH@:near
   1.633 +		call	N_LXLSH@
   1.634 +@@noshift:
   1.635 +		popf
   1.636 +		jne	@@end
   1.637 +		not	dx
   1.638 +		neg	ax
   1.639 +		jne	@@end
   1.640 +		inc	dx
   1.641 +		endif
   1.642 +@@end:
   1.643 +@@setnum:
   1.644 +		mov	[di+2],dx
   1.645 +@@setnum2:
   1.646 +		xchg	ax,si
   1.647 +@@done:
   1.648 +		or	[di],si
   1.649 +		xchg	ax,di
   1.650 +@@nokeyword:
   1.651 +		pop	di si bx
   1.652 +		ret
   1.653 +
   1.654 +@@notvga:
   1.655 +		mov	cl,10			; radix
   1.656 +		cmp	al,'-'
   1.657 +		jne	@@radixkeep
   1.658 +		lodsb
   1.659 +@@radixkeep:
   1.660 +		pushf
   1.661 +		cmp	al,'0'
   1.662 +		jne	@@radixok
   1.663 +		mov	cl,8
   1.664 +		lodsb
   1.665 +		or	al,20h
   1.666 +		cmp	al,'x'
   1.667 +		jne	@@radixok
   1.668 +		mov	cl,16
   1.669 +@@strtollp:
   1.670 +		lodsb
   1.671 +@@radixok:
   1.672 +		or	al,20h
   1.673 +		sub	al,'0'
   1.674 +		jb	@@endstrtol
   1.675 +		cmp	al,9
   1.676 +		jbe	@@digitok
   1.677 +		cmp	al,'a'-'0'
   1.678 +		jb	@@endstrtol
   1.679 +		sub	al,'a'-'0'-10
   1.680 +@@digitok:
   1.681 +		cmp	al,cl
   1.682 +		jae	@@endstrtol
   1.683 +		cbw
   1.684 +		ifndef	NO386
   1.685 +		cwde
   1.686 +		xchg	eax,ebx
   1.687 +		mul	ecx
   1.688 +		add	ebx,eax
   1.689 +		else
   1.690 +		push	ax
   1.691 +		xchg	ax,dx
   1.692 +		mul	cx
   1.693 +		xchg	ax,bx
   1.694 +		mul	cx
   1.695 +		add	dx,bx
   1.696 +		pop	bx
   1.697 +		add	bx,ax
   1.698 +		adc	dx,0
   1.699 +		endif
   1.700 +		jmp	@@strtollp
   1.701 +
   1.702 +	endp	@argstr$qpxzcxt1ppxzc
   1.703 +
   1.704 +;===============================================================
   1.705  
   1.706          ends    _TEXT
   1.707  
     2.1 --- a/linld/stuff/src/VCPI.ASM	Sat Dec 25 15:56:57 2021 +0000
     2.2 +++ b/linld/stuff/src/VCPI.ASM	Sun Dec 26 17:19:46 2021 +0000
     2.3 @@ -279,8 +279,7 @@
     2.4  		test	bx,bx
     2.5  		jnz	vm2rm_end
     2.6  
     2.7 -                ;lea     sp,[bp-8-9*4]
     2.8 -                lea     sp,[bp-9*4]
     2.9 +                lea     sp,[bp-8-9*4]
    2.10  
    2.11  ; Call the routine (bp points to params on stack if any)
    2.12                  call    do_memcpy_vcpi	; set ds=all_addrspace
    2.13 @@ -290,9 +289,7 @@
    2.14                  cli     ; to be safe
    2.15                  clts    ;
    2.16  ; Go to vm86 mode. Sregs, esp, eflags (IF) restored from IRET stack
    2.17 -                call	[pword cs:vcpi_pm_entry]
    2.18 -		ret
    2.19 -                ;jmp	[pword cs:vcpi_pm_entry]
    2.20 +                jmp	[pword cs:vcpi_pm_entry]
    2.21  
    2.22  ;***************************************************************
    2.23  
     3.1 --- a/linld/stuff/src/_BEG.ASM	Sat Dec 25 15:56:57 2021 +0000
     3.2 +++ b/linld/stuff/src/_BEG.ASM	Sun Dec 26 17:19:46 2021 +0000
     3.3 @@ -181,7 +181,7 @@
     3.4                  smsw    bx      ;SMSW cannot be trapped! :-)
     3.5                  shr	bx,1	;MSW_PE
     3.6  ; We're in vm
     3.7 -		jnc	check_vcpi
     3.8 +		jc	check_vcpi
     3.9  
    3.10  check_rm_paging:
    3.11  ; It's a 386 in real mode, chk for paging (crazy but possible)
    3.12 @@ -205,18 +205,13 @@
    3.13  label   check_vcpi near
    3.14                  p386
    3.15  		ifdef	VCPI
    3.16 -; Check whether it is safe to call 67h
    3.17 -		xor	eax,eax
    3.18 -                mov     es,ax
    3.19 -                cmp     [dword es:67h*4],eax
    3.20 -                je      no_vcpi
    3.21                  mov     ah,0DEh		; check for vcpi present
    3.22                  int     67h
    3.23                  or	ah,ah
    3.24  		jnz	no_vcpi
    3.25  is386vcpi:
    3.26                  extrn   prepare_vcpi:near
    3.27 -		call	prepare_vcpi
    3.28 +		call	prepare_vcpi	; assume ES = DS
    3.29  ;    get_vcpi_interface() || die("VCPI: low 640k: need 1:1 mapping");
    3.30                  ;extrn   _get_vcpi_interface:near
    3.31  		;call	_get_vcpi_interface
     4.1 --- a/syslinux/stuff/iso2exe/taziso	Sat Dec 25 15:56:57 2021 +0000
     4.2 +++ b/syslinux/stuff/iso2exe/taziso	Sun Dec 26 17:19:46 2021 +0000
     4.3 @@ -895,7 +895,9 @@
     4.4  
     4.5  xfile()
     4.6  {
     4.7 -	[ "$(which $1)" ] && menuitem "$@"
     4.8 +	for i in $1; do
     4.9 +		[ "$(which $i)" ] && menuitem "$@" && break
    4.10 +	done
    4.11  }
    4.12  
    4.13  initxfile()
    4.14 @@ -1547,8 +1549,8 @@
    4.15  
    4.16  infoiso()
    4.17  {
    4.18 -	isoinfo -d -i "$ISO" > /tmp/isoinfo$$
    4.19 -	if [ -x "$(which iso2exe)" ]; then
    4.20 +	isoinfo -d -i "$ISO" > /tmp/isoinfo$$ 2> /dev/null
    4.21 +	if [ "$(which iso2exe)" ]; then
    4.22  		echo "----"
    4.23  		blkid "$ISO" | while read args; do
    4.24  			set -- $args
    4.25 @@ -1571,6 +1573,16 @@
    4.26  	else
    4.27  		$DIALOG --clear --title " Info ISO " \
    4.28  			--textbox /tmp/isoinfo$$ 0 0
    4.29 +		files=$(sed '/^custom.*d/!d;s| .*||' /tmp/isoinfo$$)
    4.30 +		if [ "$files" ]; then
    4.31 +			$DIALOG --clear --title " Extract custom files " \
    4.32 +				--defaultno --yesno \
    4.33 +				"Do you want to extract the custom boot files ?\n$files" 7 70
    4.34 +			[ $? -eq 0 ] && for i in $files ; do
    4.35 +				echo "Extract $i ..."
    4.36 +				iso2exe -l "$ISO" $i
    4.37 +			done
    4.38 +		fi
    4.39  	fi
    4.40  	rm -f /tmp/isoinfo$$
    4.41  }
    4.42 @@ -1648,7 +1660,7 @@
    4.43  $(cdfile 'md5sum*'	"md5"		"Check the ISO files") \
    4.44  $(cdfile 'sha*sum*'	"sha"		"Check the ISO files") \
    4.45  $(menuitem		"filepos"	"File start sector") \
    4.46 -$(xfile isoinfo		"infoiso"	"ISO image info") \
    4.47 +$(xfile 'isoinfo iso2exe'	"infoiso"	"ISO image info") \
    4.48  $(cdfilex 'bzImage*'	"bootiso"	"Boot the ISO image") \
    4.49  $(burnable		"burniso"	"Burn the ISO image") \
    4.50  $(blankable		"blankcd"	"Blank the CD/DVD") \