wok-6.x diff linld/stuff/src/CRTL.ASM @ rev 20630

Up firefox-official (64.0), again
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 03 12:04:23 2019 +0100 (2019-01-03)
parents cb4579b9835b
children ab907169f156
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Dec 01 16:48:25 2018 +0100
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Thu Jan 03 12:04:23 2019 +0100
     1.3 @@ -48,9 +48,9 @@
     1.4          segment _TEXT byte public use16 'CODE'
     1.5  
     1.6  ;***************************************************************
     1.7 -;_fastcall void strcpy(const char* a, const char* b);
     1.8 -;_fastcall void strcat(const char* a, const char* b);
     1.9 -;_fastcall void strcatb(const char* a, const char* b);
    1.10 +;_fastcall void strcpy(bx:const char* a, ax:const char* b);
    1.11 +;_fastcall void strcat(bx:const char* a, ax:const char* b);
    1.12 +;_fastcall void strcatb(bx:const char* a, ax:const char* b);
    1.13  ;***************************************************************
    1.14          global  @strcatb$qpxzct1:near
    1.15          proc	@strcatb$qpxzct1 near
    1.16 @@ -67,19 +67,19 @@
    1.17  		xor	cx,cx
    1.18  	endif
    1.19                  push	si
    1.20 -                mov	si,bx			; a
    1.21 -		xchg	ax,dx			; b
    1.22 +                xchg	ax,bx			; b
    1.23 +                xchg	ax,si			; a
    1.24  	ifdef	EXTRA
    1.25  		jcxz	@@nocat
    1.26  	endif
    1.27  @@catlp:
    1.28 -		lodsb
    1.29 +		lodsb				; a=si
    1.30  		or	al,al
    1.31                  jne	@@catlp
    1.32  		dec	si
    1.33  	ifdef	EXTRA
    1.34 -		cmp	dx,si
    1.35 -		adc	al,cl		; set S when dx != si or cl = 80
    1.36 +		cmp	bx,si
    1.37 +		adc	al,cl		; set S when bx != si or cl = 80
    1.38  		mov	al,20h
    1.39  		jns	@@cpyhead
    1.40  	endif
    1.41 @@ -104,7 +104,7 @@
    1.42  	ifdef	EXTRA
    1.43                  p8086
    1.44  ;***************************************************************
    1.45 -;_fastcall char strstr(const char* a,const char* b);
    1.46 +;_fastcall char strstr(bx:const char* a, ax:const char* b);
    1.47  ;***************************************************************
    1.48          global  @strstr$qpxzct1:near
    1.49          proc    @strstr$qpxzct1 near
    1.50 @@ -132,7 +132,7 @@
    1.51  
    1.52  
    1.53  ;***************************************************************
    1.54 -;_fastcall int strcmp(const char* a,const char* b);
    1.55 +;_fastcall int strcmp(bx:const char* a, ax:const char* b);
    1.56  ;***************************************************************
    1.57          global  @strcmp$qpxzct1:near
    1.58          proc    @strcmp$qpxzct1 near
    1.59 @@ -145,7 +145,7 @@
    1.60  		lodsb
    1.61  		sub	al,[bx]
    1.62  		jnz	@@out
    1.63 -		or	al,al
    1.64 +		or	al,[bx]
    1.65  		jnz	@@lp
    1.66  @@out:
    1.67  		cbw
    1.68 @@ -157,7 +157,7 @@
    1.69  
    1.70  
    1.71  ;***************************************************************
    1.72 -;_fastcall void puts(const char* s):
    1.73 +;_fastcall void puts(bx:const char* s):
    1.74  ;***************************************************************
    1.75          global  @puts$qpxzc:near
    1.76          proc    @puts$qpxzc near
    1.77 @@ -181,7 +181,7 @@
    1.78  
    1.79  
    1.80  ;***************************************************************
    1.81 -;_fastcall int fileattr(const char* name);
    1.82 +;_fastcall int fileattr(bx:const char* name);
    1.83  ;***************************************************************
    1.84          global  @fileattr$qpxzc:near
    1.85          proc    @fileattr$qpxzc near
    1.86 @@ -195,7 +195,7 @@
    1.87  
    1.88  
    1.89  ;***************************************************************
    1.90 -;_fastcall int open(const char* name, int flags=O_RDONLY);
    1.91 +;_fastcall int open(bx:const char* name, int flags=O_RDONLY);
    1.92  ;***************************************************************
    1.93          global  openargs:near			; openargs(bx)
    1.94  openargs:
    1.95 @@ -209,6 +209,18 @@
    1.96  
    1.97          global  open:near			; open(bx)
    1.98  open:
    1.99 +	ifdef	LONG_FILENAME
   1.100 +		mov	ax,716Ch
   1.101 +		push	bx si di
   1.102 +		mov	di,di			; alias hint
   1.103 +		mov	si,bx
   1.104 +		xor	bx,bx			; R/O
   1.105 +		xor	cx,cx			; attributes
   1.106 +		cwd				; action = open
   1.107 +                int	21h
   1.108 +		pop	di si bx
   1.109 +                jnc	doret
   1.110 +	endif
   1.111                  mov	ax,3d00h		; read-only+compatibility
   1.112  		;mov	cl,0			; attribute mask
   1.113  dos_filename:
   1.114 @@ -232,7 +244,7 @@
   1.115  
   1.116  
   1.117  ;***************************************************************
   1.118 -;_fastcall int close(int fd);
   1.119 +;_fastcall int close(ax:int fd);
   1.120  ;***************************************************************
   1.121          global  @close$qi:near
   1.122          proc    @close$qi near
   1.123 @@ -249,8 +261,8 @@
   1.124  
   1.125  
   1.126  ;***************************************************************
   1.127 -;_fastcall int read(int fd, void* data, int sz);
   1.128 -;_fastcall int write(int fd, const void* data, int sz);
   1.129 +;_fastcall int read(ax:int fd, bx:void* data, dx:int sz);
   1.130 +;_fastcall int write(ax:int fd, bx:const void* data, dx:int sz);
   1.131  ;***************************************************************
   1.132          global  @read$qipvi:near
   1.133          proc    @read$qipvi near
   1.134 @@ -279,8 +291,8 @@
   1.135          endp    @read$qipvi
   1.136  
   1.137  ;***************************************************************
   1.138 -;_fastcall long lseekset(int fd, unsigned whence);
   1.139 -;_fastcall long lseekcur(int fd, int whence);
   1.140 +;_fastcall long lseekset(ax:int fd, dx:unsigned whence);
   1.141 +;_fastcall long lseekcur(ax:int fd, dx:int whence);
   1.142  ;***************************************************************
   1.143  
   1.144          global  @lseekcur$qii:near		; fd=ax whence=dx
   1.145 @@ -333,7 +345,7 @@
   1.146  buffer		db	2560	dup(?)	;28	char buffer[2048+512];
   1.147  ends					; } isostate;
   1.148  ;***************************************************************
   1.149 -;_fastcall long isolseek(const unsigned long *offset);
   1.150 +;_fastcall long isolseek(bx:const unsigned long *offset);
   1.151  ;***************************************************************
   1.152          global  @isolseek$qpxul:near
   1.153          proc    @isolseek$qpxul near
   1.154 @@ -348,7 +360,7 @@
   1.155  	endp	@isolseek$qpxul
   1.156  
   1.157  ;***************************************************************
   1.158 -;_fastcall int isoreadsector(const unsigned long *offset);
   1.159 +;_fastcall int isoreadsector(bx:const unsigned long *offset);
   1.160  ;***************************************************************
   1.161          global  @isoreadsector$qpxul:near
   1.162          proc    @isoreadsector$qpxul near
   1.163 @@ -372,7 +384,7 @@
   1.164  
   1.165  
   1.166  ;***************************************************************
   1.167 -;_fastcall int strhead(const char* a,const char* b);
   1.168 +;_fastcall int strhead(bx:const char* a, ax:const char* b);
   1.169  ;***************************************************************
   1.170          global  @strhead$qpxzct1:near
   1.171          proc    @strhead$qpxzct1 near
   1.172 @@ -394,7 +406,7 @@
   1.173  
   1.174  
   1.175  ;***************************************************************
   1.176 -;_fastcall char* malloc_or_die(unsigned size);
   1.177 +;_fastcall char* malloc_or_die(ax:unsigned size);
   1.178  ;***************************************************************
   1.179          global  @malloc_or_die$qui:near
   1.180          proc    @malloc_or_die$qui near
   1.181 @@ -416,7 +428,7 @@
   1.182  
   1.183  
   1.184  ;***************************************************************
   1.185 -;_fastcall int die(const char* msg);
   1.186 +;_fastcall int die(bx:const char* msg);
   1.187  ;int exit();
   1.188  ;int abort();
   1.189  ;***************************************************************
   1.190 @@ -461,7 +473,7 @@
   1.191  ends				;};
   1.192  
   1.193  ;***************************************************************
   1.194 -;long next_chunk(struct image_himem *di);
   1.195 +;static long next_chunk(struct image_himem *di);
   1.196  ;***************************************************************
   1.197          proc    next_chunk near
   1.198  
   1.199 @@ -537,7 +549,7 @@
   1.200  	endif
   1.201  
   1.202  ;***************************************************************
   1.203 -;_fastcall u32* malloc_bufv_or_die(struct image_himem *m);
   1.204 +;_fastcall u32* malloc_bufv_or_die(bx:struct image_himem *m);
   1.205  ;***************************************************************
   1.206          global  @malloc_bufv_or_die$qp11image_himem:near
   1.207          proc    @malloc_bufv_or_die$qp11image_himem near
   1.208 @@ -657,7 +669,7 @@
   1.209  
   1.210  
   1.211  ;***************************************************************
   1.212 -;_fastcall void memcpy_image(struct image_himem *m);
   1.213 +;_fastcall void memcpy_image(bx:struct image_himem *m);
   1.214  ;***************************************************************
   1.215          global  @memcpy_image$qp11image_himem:near
   1.216          proc    @memcpy_image$qp11image_himem near
   1.217 @@ -718,7 +730,7 @@
   1.218          endp    @memcpy_image$qp11image_himem
   1.219  
   1.220  ;***************************************************************
   1.221 -;_fastcall void storepage(u32 *dst);
   1.222 +;_fastcall void storepage(bx:u32 *dst);
   1.223  ;***************************************************************
   1.224          global  @storepage$qpul:near
   1.225          proc    @storepage$qpul near
   1.226 @@ -753,7 +765,7 @@
   1.227  	ifdef	LARGE_IMAGES
   1.228                  p386
   1.229  ;***************************************************************
   1.230 -;_fastcall void reset_bufv(u32 *p);
   1.231 +;_fastcall void reset_bufv(bx:u32 *p);
   1.232  ;***************************************************************
   1.233          global  @reset_bufv$qpul:near
   1.234          proc    @reset_bufv$qpul near
   1.235 @@ -827,7 +839,7 @@
   1.236  		endif
   1.237  
   1.238  ;***************************************************************
   1.239 -;_fastcall void open_image(const char *name, struct image_himem *m);
   1.240 +;_fastcall void open_image(bx:const char *name, ax:struct image_himem *m);
   1.241  ;***************************************************************
   1.242          global  @open_image$qpxzcp11image_himem:near
   1.243          proc    @open_image$qpxzcp11image_himem near
   1.244 @@ -871,7 +883,7 @@
   1.245  
   1.246  
   1.247  ;***************************************************************
   1.248 -;_fastcall int read_image(struct image_himem *m);
   1.249 +;_fastcall int read_image(bx:struct image_himem *m);
   1.250  ;***************************************************************
   1.251          global  @read_image$qp11image_himem:near
   1.252          proc    @read_image$qp11image_himem near
   1.253 @@ -1220,7 +1232,7 @@
   1.254  
   1.255  
   1.256  ;***************************************************************
   1.257 -;_fastcall void chdirname(char *path)
   1.258 +;_fastcall void chdirname(bx:char *path)
   1.259  ;***************************************************************
   1.260          global  @chdirname$qpzc:near
   1.261          proc    @chdirname$qpzc near
   1.262 @@ -1250,11 +1262,13 @@
   1.263  		mov	bx,dx
   1.264  		push	[word bx]
   1.265  		mov	[bx],al
   1.266 +	ifdef	LONG_FILENAME
   1.267  		stc
   1.268  		mov	ax,713Bh		; chdir long filename (ds:dx)
   1.269  		int	21h
   1.270 +		jnc	@@chdirdone
   1.271 +	endif
   1.272  		mov	ah,3Bh			; chdir(ds:dx)
   1.273 -		jnc	@@chdirdone
   1.274  		int	21h
   1.275  @@chdirdone:
   1.276  		pop	[word bx]
   1.277 @@ -1265,7 +1279,7 @@
   1.278  
   1.279  
   1.280  ;***************************************************************
   1.281 -;_fastcall char *ultoa(unsigned long n);
   1.282 +;_fastcall char *ultoa(axdx:unsigned long n);
   1.283  ;***************************************************************
   1.284          global  @ultoa$qul:near
   1.285          proc    @ultoa$qul near
   1.286 @@ -1296,7 +1310,7 @@
   1.287  
   1.288  
   1.289  ;***************************************************************
   1.290 -;_fastcall unsigned long kver2ul(char *kernel_version);
   1.291 +;_fastcall unsigned long kver2ul(bx:char *kernel_version);
   1.292  ;***************************************************************
   1.293          global  @kver2ul$qpzc:near
   1.294          proc    @kver2ul$qpzc near
   1.295 @@ -1331,7 +1345,6 @@
   1.296  
   1.297  ;***************************************************************
   1.298  ;void try_default_args();
   1.299 -;_fastcall void set_cmdline(const char *filename);
   1.300  ;***************************************************************
   1.301  	ifdef	EXTRA
   1.302