wok rev 20539

linld: _fastcall calls (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 29 10:54:56 2018 +0100 (2018-11-29)
parents 65366955881f
children 8338e8d728f8
files linld/stuff/src/CRTL.ASM
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Wed Nov 28 19:46:10 2018 +0100
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Thu Nov 29 10:54:56 2018 +0100
     1.3 @@ -49,19 +49,19 @@
     1.4  
     1.5  ;***************************************************************
     1.6  ;_fastcall void strcpy(const char* a, const char* b);
     1.7 -;_fastcall void  strcat(const char* a, const char* b);
     1.8 -;_fastcall void  strcatb(const char* a, const char* b);
     1.9 +;_fastcall void strcat(const char* a, const char* b);
    1.10 +;_fastcall void strcatb(const char* a, const char* b);
    1.11  ;***************************************************************
    1.12          global  @strcatb$qpxzct1:near
    1.13          proc	@strcatb$qpxzct1 near
    1.14  
    1.15  	ifdef	EXTRA
    1.16  		mov	cl,7Fh
    1.17 -		db	0bbh			; mov	bx,imm opcode
    1.18 +		db	0bah			; mov	dx,imm opcode
    1.19          global  @strcat$qpxzct1:near
    1.20  @strcat$qpxzct1:
    1.21  		mov	cl,80h
    1.22 -		db	0bbh			; mov	bx,imm opcode
    1.23 +		db	0bah			; mov	dx,imm opcode
    1.24          global	@strcpy$qpxzct1:near
    1.25  @strcpy$qpxzct1:
    1.26  		xor	cx,cx
    1.27 @@ -861,19 +861,18 @@
    1.28          global  @read_image$qp11image_himem:near
    1.29          proc    @read_image$qp11image_himem near
    1.30  
    1.31 -		push	bp si di
    1.32 +		push	si di
    1.33  		mov	di,bx
    1.34 -		mov	si,offset _xfer_buf
    1.35 -		mov	bp,4096
    1.36 -		push	bp		; original size
    1.37 +		mov	si,4096
    1.38 +		push	si		; original size
    1.39  @@loop:
    1.40  		ifndef	NO386
    1.41 -		movzx	ecx,bp
    1.42 +		movzx	ecx,si
    1.43  		mov	eax,[(image_himem di).chunk_size]
    1.44  		cmp	ecx,eax
    1.45  		jb	@@szok
    1.46  		else
    1.47 -		mov	cx,bp
    1.48 +		mov	cx,si
    1.49  		mov	ax,[word (image_himem di).chunk_size]
    1.50  		cmp	cx,ax
    1.51  		jb	@@szok
    1.52 @@ -883,49 +882,50 @@
    1.53  		xchg	ax,cx
    1.54  @@szok:
    1.55  		jcxz	image_done
    1.56 -		mov	dx,si
    1.57 +		mov	dx,offset _xfer_buf
    1.58  		mov	bx,[di]
    1.59  		call	@read$cxdxbx
    1.60  		jc	image_done
    1.61 -		add	si,ax
    1.62  		xor	cx,cx
    1.63 +		cwd				; ax < 8000h
    1.64  		ifndef	NO386
    1.65  		cwde				; ax < 8000h
    1.66  		sub	[(image_himem di).chunk_size],eax
    1.67 +		mov	bx,ax
    1.68  		else
    1.69 -		cwd				; ax < 8000h
    1.70  		sub	[word (image_himem di).chunk_size],ax
    1.71 +		xchg	ax,bx
    1.72  		sbb	[word ((image_himem di).chunk_size)+2],dx
    1.73  		jnz	@@fill
    1.74  		cmp	[word (image_himem di).chunk_size],dx
    1.75  		endif
    1.76  		jnz	@@fill
    1.77 -		inc	cx
    1.78 +		dec	cx
    1.79  @@fill:
    1.80 -		test	al,3
    1.81 +		test	bl,3
    1.82  		je	@@filled
    1.83 -		mov	[si],ch
    1.84 -		inc	si
    1.85 -		inc	ax
    1.86 +		mov	[bx+_xfer_buf],dh
    1.87 +		inc	bx
    1.88  		jmp	@@fill
    1.89  @@filled:
    1.90  		ifndef	NO386
    1.91  		sub	[(image_himem di).remaining],eax
    1.92  		else
    1.93 -		sub	[word (image_himem di).remaining],ax
    1.94 +		sub	[word (image_himem di).remaining],bx
    1.95  		sbb	[word ((image_himem di).remaining)+2],dx
    1.96  		endif
    1.97 -		sub	bp,ax
    1.98 +		sub	si,ax
    1.99  		pushf
   1.100 +                and	cx,[(image_himem di).next_chunk]
   1.101  		jcxz	@@same_chunk
   1.102 -                call	[(image_himem di).next_chunk]
   1.103 +		call	cx
   1.104  @@same_chunk:
   1.105  		popf
   1.106  		jnz	@@loop
   1.107  image_done:
   1.108                  pop	ax		; original size
   1.109 -		sub	ax,bp
   1.110 -                pop	di si bp
   1.111 +		sub	ax,si
   1.112 +                pop	di si
   1.113  		ret
   1.114  
   1.115          endp    @read_image$qp11image_himem