# HG changeset patch # User Pascal Bellard # Date 1640349112 0 # Node ID 530dacfd6585c99b6c8f81e6d07ba97b4f8dc715 # Parent be11ceb31dcfeeb1ec578d7034de7cfd0cf77da1 Up lzsa (1.3.9) diff -r be11ceb31dcf -r 530dacfd6585 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Wed Dec 22 13:43:13 2021 +0100 +++ b/linld/stuff/src/CRTL.ASM Fri Dec 24 12:31:52 2021 +0000 @@ -47,13 +47,11 @@ segment _TEXT byte public use16 'CODE' - ifdef VCPI - p386 ;*************************************************************** struc data_himem ;struct data_himem { first dd ? ; 0 u32 first; *must* be the first one assume zero'd in bss -cacheidx dw ? ; 4 int cacheidx; quad * assume zero'd in bss +cacheidx dw ? ; 4 int cacheidx; byte * assume zero'd in bss pageidx dw ? ; 6 int pageidx; byte * assume zero'd in bss cache dd 1024 dup(?) ; 8 int cache; page dd 1024 dup(?) ;4104 int page; @@ -61,270 +59,6 @@ include "himem.inc" -;*************************************************************** -;_fastcall u32* malloc_bufv_or_die(si:struct image_himem *m); -;*************************************************************** - global @malloc_bufv_or_die$qp11image_himem:near - proc @malloc_bufv_or_die$qp11image_himem near - - p386 - ;mov ecx,[(image_himem si).size] - ;shr ecx,20 ; pages index size = size >> 20 - ;mov ax,cx - ;add ax,size data_himem-4096 - mov ax,size data_himem - call malloc_or_die - ;mov cx,4096+4095 ; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE; - mov ecx,4096+4095 ; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE; - add ecx,[(image_himem si).size] - shr ecx,12 - mov [(image_himem si).bufv],ax ; update m->bufv - xchg ax,di -@@vcpi_alloc: - mov ax,0DE04h ; allocate a 4K page => EDX - int 67h - or ah,ah - mov bx,offset vcpi_alloc_err - jnz jmpdie -; for (i = cnt-1; i >= 0; i--) -; if (edx < pm.fallback+pm.size) again - mov bx,offset _imgs.fallback+size image_himem - mov eax,[bx-2+6-size image_himem] ; pm.size - add eax,[bx-2+2-size image_himem] - cmp eax,edx ; pm.fallback+pm.size <= edx ? - ja @@vcpi_alloc - mov eax,ecx - dec eax - shl eax,12 ; i*_4k -; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again - add eax,[bx-2+2] ; +initrd.fallback - cmp eax,edx ; initrd.fallback+i*_4k > edx ? - ja @@initrdok - mov eax,[bx-2+6] ; initrd.size - add eax,[bx-2+2] ; +initrd.fallback - cmp eax,edx ; initrd.fallback+initrd.size > edx ? -@@ja_vcpi_alloc: - ja @@vcpi_alloc -@@initrdok: - cmp [(data_himem di).first],0 ; zero'd in bss - jne @@notfirst - mov [(data_himem di).first],edx -@@notfirst: - mov bx,[(data_himem di).cacheidx] ; zero'd in bss - cmp bh,4 - jae @@nextpage - shl bx,2 - inc [(data_himem di).cacheidx] - mov [(data_himem bx+di).cache],edx ; cache[cacheidx++] = edx - loopd @@vcpi_alloc - mov [(data_himem bx+di).cache],ecx ; last is 0 -@@nextpage: - and [(data_himem di).cacheidx],0 - mov bx,[(data_himem di).pageidx] ; zero'd in bss - mov [(data_himem bx+di).page],edx - add [(data_himem di).pageidx],4 - push cx - lea cx,[(data_himem di).cache] - ifdef NO386 - push edx - pop ax ; to es:ax - pop es - endif - call storepage ; storepage(edx/es:ax,cx) - pop cx - or ecx,ecx ; clear C - jnz @@ja_vcpi_alloc - - endp @malloc_bufv_or_die$qp11image_himem - -;*************************************************************** -;_fastcall void reset_bufv(di:u32 *p); -;*************************************************************** - global @reset_bufv$qpul:near - proc @reset_bufv$qpul near - - mov [curdata],di - and [dword (data_himem di).cacheidx],0 ; and pageidx=0 - ret - - endp @reset_bufv$qpul - -;*************************************************************** -;u32* di=prev_bufv(); -;u32* di=prev_bufv(); -;*************************************************************** - global _prev_bufv:near - global _next_bufv:near - proc _prev_bufv near - - stc - db 73h ; jnc -_next_bufv: - clc - push si - mov bx,0 - org $-2 -curdata dw ? - sbb ax,ax - cmc - adc ax,[(data_himem bx).cacheidx] ; -1/+1 - mov si,3ffh - and si,ax - mov [(data_himem bx).cacheidx],si - shl si,2 - xor ecx,ecx - test ax,0fc00h - jz @@gotpage ; FFFF / 0400 - xchg al,ah ; FFFC / 0004 - and al,0fch - add [(data_himem bx).pageidx],ax - mov di,[(data_himem bx).pageidx] - lea di,[(data_himem bx+di).page] - mov edx,ds - shl edx,4 - lea cx,[(data_himem bx).cache] - add edx,ecx - mov eax,[di] - or eax,eax - jz @@ret - mov cx,4096 ; get page - call memcpy_imagez ; memcpy_imagez(edx,eax,ecx) -@@gotpage: - lea ax,[(data_himem bx+si).cache] - or si,[(data_himem bx).pageidx] ; !pageidx && !cacheidx - jnz @@notfirst2 - xchg ax,bx ; &first -@@notfirst2: - xchg ax,di -@@ret: - pop si - ret - - endp _prev_bufv - endif - - ifdef NO386 - p8086 - endif - -;*************************************************************** -;_fastcall void memcpy_image_initrd(si:struct image_himem *m); -;_fastcall void memcpy_image_kernel(si:struct image_himem *m); -;_fastcall void memcpy_image(bx:struct image_himem *m); -;*************************************************************** - global @memcpy_image_initrd$qv:near -@memcpy_image_initrd$qv: - lea bx,[si+size image_himem] - db 0A9h ; test ax,imm - global @memcpy_image_kernel$qv:near -@memcpy_image_kernel$qv: - mov bx,si - proc @memcpy_image$qp11image_himem near - - ifndef NO386 - mov edx,[(image_himem bx).fallback] - mov eax,[(image_himem bx).buf] - cmp eax,edx ; if (m->fallback != m->buf) - jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) - mov ecx,[(image_himem bx).size] - else - les cx,[((image_himem bx).buf)] - mov dx,es - les ax,[((image_himem bx).fallback)] - cmp ax,cx ; if (m->fallback != m->buf) - jnz @@do - cmp dx,[word ((image_himem bx).fallback)+2] - jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) -@@do: - push [((image_himem bx).size)] - xor bx,bx -call_memcpy32: ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) - push dx ; [word ((image_himem bx).buf)+2] - push cx ; [word ((image_himem bx).buf)] - push bx - push es ; push es:ax - push ax - jmp @@memcpy - endif -memcpy_imagez: ; memcpy_imagez(edx,eax,ecx) - p386 - push ecx - push eax - push 0 - ifndef NO386 -call_memcpy32: ; call_memcpy32(to=edx,fromseg,fromofs,size) - endif - push edx - ifdef NO386 - p8086 - endif -@@memcpy: - extrn memcpy32:near - call near memcpy32 -@@skip: - ret - - global movedend:near -movedend: - - endp @memcpy_image$qp11image_himem - -;*************************************************************** -;_fastcall void storepage(di:u32 *dst); -;*************************************************************** - global @storepage$qpul:near - proc @storepage$qpul near - - ifndef NO386 - mov edx,[di] - else - les ax,[dword di] - endif - mov cx,offset _buf4k -storepage: ; storepage(edx,cx) - ifndef NO386 - push 0 - push 4096 - push 0 - push cx - push ds ; call_memcpy32(to=edx,fromseg,fromofs,size) - else - xor dx,dx - push dx ; 0 - mov bx,4096 - push bx ; 4096 - mov bx,ds ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) - endif - jmp call_memcpy32 - - endp @storepage$qpul - -;*************************************************************** -;_fastcall void strcatb(bx:const char* a, ax:const char* b); -;*************************************************************** - global @strcatb$qpxzct1:near - proc @strcatb$qpxzct1 near - - push si - xchg ax,si ; b - dec bx -@@catlp: - inc bx - cmp [byte bx],0 ; a=bx - jne @@catlp - db 0b8h,20h ; mov ax,??20h -@@cpylp: - lodsb - mov [bx],al - inc bx - or al,al - jne @@cpylp - pop si -catret: - ret - - endp @strcatb$qpxzct1 - ifdef NO386 p8086 @@ -332,8 +66,8 @@ ifndef ISO9660 ;*************************************************************** -;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY); -;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY); +;_fastcall int:C open(bx:const char* name, const flags=O_RDONLY); +;_fastcall int:C openargs(bx:const char* name, const flags=O_RDONLY); ;*************************************************************** global openargs:near ; openargs(bx) openargs: @@ -346,7 +80,6 @@ endif opendos: ifdef LONG_FILENAME - ;xchg ax,cx ; attributes mov ax,716Ch push bx si mov si,bx @@ -355,17 +88,15 @@ stc int 21h pop si dx - jnc openok - mov ax,3d00h ; read-only+compatibility + jnc @@openok else - mov ah,3dh ; read-only+compatibility mov dx,bx ; open(DS:DX=filename,al=access,cl=attributes) endif - ;mov cl,0 ; attribute mask + mov ax,3d00h ; read-only+compatibility call dos ifdef ISO9660 - jc catret -openok: + jc @@openret +@@openok: xchg ax,bx mov ax,4202h cwd @@ -378,9 +109,10 @@ cwd call seeksetpos0 ; filepos = 0 else -openok: +@@openok: endif xchg ax,bx ; fd +@@openret: ret ifdef ISO9660 @@ -389,8 +121,8 @@ extrn _isostate:isostate ;*************************************************************** -;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY); -;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY); +;_fastcall int:C open(bx:const char* name, const flags=O_RDONLY); +;_fastcall int:C openargs(bx:const char* name, const flags=O_RDONLY); ;*************************************************************** global openargs:near ; openargs(bx) openargs: @@ -400,15 +132,9 @@ global @open$qpxzc:near @open$qpxzc: - ifdef LONG_FILENAME - mov cx,[_isostate.fd] - jcxz opendos - xchg ax,cx - else mov ax,[_isostate.fd] or ax,ax - je opendos - endif + jz opendos ifdef ISOHOOK cmp [byte bx],'!' je @readmenu$qv @@ -425,7 +151,7 @@ global @fileexist$qpxzc:near @fileexist$qpxzc: call @open$qpxzc - jc fail + jc failifc ;*************************************************************** ;_fastcall int close(ax:int fd); @@ -439,8 +165,10 @@ ifdef ISO9660 mov cx,[_isostate.fd] jcxz dosbx + ret + else + jmp dosbx endif - jmp fail endp @close$qi @@ -455,26 +183,24 @@ mov bx,[si-2] ; data proc @read$qipvi near -@read$dxbxax: +@read$dxbxax: ; dx:size bx:data ax:fd xchg ax,bx ; fd -@read$dxaxbx: +@read$dxaxbx: ; dx:size ax:data bx:fd xchg ax,dx ; data xchg ax,cx ; sz global @read$cxdxbx:near -@read$cxdxbx: +@read$cxdxbx: ; cx:size dx:data bx:fd ifdef ISO9660 push bx mov bx,offset _isostate.filepos push cx - mov cx,[bx-4] ; filesize + les cx,[bx-4] ; filesize sub cx,[bx] ; filepos - mov ax,[bx-2] + mov ax,es sbb ax,[bx+2] pop ax - ja @@axok - ;je @@rem - ;xor ax,ax -@@rem: + ;jb fail ; filepos > filesize ??? + jne @@axok cmp cx,ax jb @@cxok @@axok: @@ -489,12 +215,12 @@ ;jcxz fail dos: int 21h - jnc doret + jnc @@doret fail: stc failifc: sbb ax,ax ; ax=-1 CF -doret: +@@doret: ret endp @read$qipvi @@ -591,7 +317,7 @@ proc @isoreadsector$qpxul near call isolseek ; filepos = 0 - jc fail + jc failifc mov cx,2048 mov dx,offset _buf2k jmp readfd ; read(fd,buf2k,2048) @@ -630,8 +356,7 @@ proc @strcmp$qpxzct1 near call @strhead$qpxzct1 - jne fail ; return -1 - xor dh,[bx] ; clear C + or dh,[bx] ; clear C jne fail ; return -1 jmp failifc ; return 0, dh=0 @@ -667,34 +392,6 @@ endif ;*************************************************************** -;_fastcall void puts(bx:const char* s): -;*************************************************************** - global @puts$qpxzc:near - -; global puts:near ; puts(bx) -@putsz: - call @putc -@puts$qpxzc: -puts: - mov dl,[bx] - inc bx - or dl,dl - jne @putsz - mov dl,10 -@putc: - cmp dl,10 - jne @putcz - call @putcz2 -@putcz2: - xor dl,7 ; 10^13 1010^1101 -@putcz: - mov ah,2 -do_int21h: - int 21h - ret - - -;*************************************************************** ;_fastcall char* malloc_or_die(ax:unsigned size); ;*************************************************************** xchg_heap_top: @@ -742,34 +439,31 @@ endp @die$qpxzc ;*************************************************************** -;_fastcall void open_image(si:struct image_himem *m, ax:const char *name); +;_fastcall void puts(bx:const char* s): ;*************************************************************** + global @puts$qpxzc:near - global @open_image$qp11image_himempxzc:near - proc @open_image$qp11image_himempxzc near - - mov [(image_himem si).state],ax - push ax -@@next: - call next_chunk - ifndef NO386 - add eax,3 - and al,0FCh - add [(image_himem si).size],eax ; m->size += m->chunk_size size zero'd in bss - or eax,eax - else - add ax,3 - adc dx,0 - and al,0FCh - add [word (image_himem si).size],ax ; m->size += m->chunk_size size zero'd in bss - adc [word ((image_himem si).size)+2],dx - or ax,dx - endif - jnz @@next - pop [(image_himem si).state] - - endp @open_image$qp11image_himempxzc - +; global puts:near ; puts(bx) +@putsz: + call @putc +@puts$qpxzc: +puts: + mov dl,[bx] + inc bx + or dl,dl + jne @putsz + mov dl,10 +@putc: + cmp dl,10 + jne @putcz + call @putcz2 +@putcz2: + xor dl,7 ; 10^13 1010^1101 +@putcz: + mov ah,2 +do_int21h: + int 21h + ret ;*************************************************************** ;static long next_chunk(struct image_himem *si); @@ -790,17 +484,15 @@ mov bx,[(image_himem si).state] cmp al,[bx] ; "" jz @@end - dec bx push di @@scan: - inc bx mov al,[bx] mov di,bx or al,al jz @@eos + inc bx sub al,',' jnz @@scan - inc bx @@eos: xchg [(image_himem si).state],bx ; set start of string mov [current_file],bx @@ -863,6 +555,128 @@ endp next_chunk + ifdef VCPI + p386 +;*************************************************************** +;_fastcall u32* malloc_bufv_or_die(si:struct image_himem *m); +;*************************************************************** + global @malloc_bufv_or_die$qp11image_himem:near + proc @malloc_bufv_or_die$qp11image_himem near + + p386 + ;mov ecx,[(image_himem si).size] + ;shr ecx,20 ; pages index size = size >> 20 + ;mov ax,cx + ;add ax,size data_himem-4096 + mov ax,size data_himem + call malloc_or_die + ;mov cx,4096+4095 ; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE; + mov ecx,4096+4095 ; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE; + add ecx,[(image_himem si).size] + shr ecx,12 + mov [(image_himem si).bufv],ax ; update m->bufv + xchg ax,di +@@vcpi_alloc: + mov ax,0DE04h ; allocate a 4K page => EDX + int 67h + or ah,ah + mov bx,offset vcpi_alloc_err + jnz jmpdie +; for (i = cnt-1; i >= 0; i--) +; if (edx < pm.fallback+pm.size) again + mov bx,offset _imgs.fallback+size image_himem + mov eax,[bx-2+6-size image_himem] ; pm.size + add eax,[bx-2+2-size image_himem] + cmp eax,edx ; pm.fallback+pm.size <= edx ? + ja @@vcpi_alloc + mov eax,ecx + dec eax + shl eax,12 ; i*_4k +; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again + add eax,[bx-2+2] ; +initrd.fallback + cmp eax,edx ; initrd.fallback+i*_4k > edx ? + ja @@initrdok + mov eax,[bx-2+6] ; initrd.size + add eax,[bx-2+2] ; +initrd.fallback + cmp eax,edx ; initrd.fallback+initrd.size > edx ? + ja @@vcpi_alloc +@@initrdok: + cmp [(data_himem di).first],0 ; zero'd in bss + jne @@notfirst + mov [(data_himem di).first],edx +@@notfirst: + mov bx,[(data_himem di).cacheidx] ; zero'd in bss + cmp bh,10h + jae @@nextpage + add [(data_himem di).cacheidx],4 + mov [(data_himem bx+di).cache],edx ; cache[cacheidx++] = edx + loopd @@vcpi_alloc + mov [(data_himem bx+di).cache],ecx ; last is 0 +@@nextpage: + and [(data_himem di).cacheidx],0 + mov bx,[(data_himem di).pageidx] ; zero'd in bss + mov [(data_himem bx+di).page],edx + add [(data_himem di).pageidx],4 + push cx + lea cx,[(data_himem di).cache] + ifdef NO386 + push edx + pop ax ; to es:ax + pop es + endif + call storepage ; storepage(edx/es:ax,cx) + pop cx + or ecx,ecx ; clear C + jnz @@vcpi_alloc + + endp @malloc_bufv_or_die$qp11image_himem + +;*************************************************************** +;_fastcall void reset_bufv(di:u32 *p); +;*************************************************************** + global @reset_bufv$qpul:near + proc @reset_bufv$qpul near + + mov [curdata],di + and [dword (data_himem di).cacheidx],0 ; and pageidx=0 + ret + + endp @reset_bufv$qpul + p8086 + endif + +;=============================================================== + +;*************************************************************** +;_fastcall void open_image(si:struct image_himem *m, ax:const char *name); +;*************************************************************** + + global @open_image$qp11image_himempxzc:near + proc @open_image$qp11image_himempxzc near + + mov [(image_himem si).state],ax + push ax +@@next: + call next_chunk + ifndef NO386 + add eax,3 + and al,0FCh + add [(image_himem si).size],eax ; m->size += m->chunk_size size zero'd in bss + or eax,eax + else + add ax,3 + adc dx,0 + and al,0FCh + add [word (image_himem si).size],ax ; m->size += m->chunk_size size zero'd in bss + adc [word ((image_himem si).size)+2],dx + or ax,dx + endif + jnz @@next + pop [(image_himem si).state] + + endp @open_image$qp11image_himempxzc + +;=============================================================== ;*************************************************************** ;_fastcall int read_image(si:struct image_himem *m); @@ -891,11 +705,11 @@ endif xchg ax,cx @@szok: - jcxz image_done + jcxz @@image_done lea dx,[di+_buf4k] mov bx,[(image_himem si).fd] call @read$cxdxbx - jb image_done + jb @@image_done add di,ax ifndef NO386 cwde ; ax < 8000h @@ -927,13 +741,15 @@ call next_chunk @@same_chunk: jmp @@loop -image_done: +@@image_done: xchg ax,di pop di ret endp @read_image$qp11image_himem +;=============================================================== + ;*************************************************************** ;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var); ;_fastcall unsigned long *argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var); @@ -1109,6 +925,186 @@ endp @argstr$qpxzcxt1ppxzc +;=============================================================== + + ifdef VCPI + p386 +;*************************************************************** +;u32* di=prev_bufv(); +;u32* di=prev_bufv(); +;*************************************************************** + global _prev_bufv:near + global _next_bufv:near + proc _prev_bufv near + + mov al,-4 + db 0A9h ; test ax,imm +_next_bufv: + mov al,4 + cbw + push si + mov bx,0 + org $-2 +curdata dw ? + add ax,[(data_himem bx).cacheidx] ; -4/+4 + mov si,0fffh + and si,ax + mov [(data_himem bx).cacheidx],si + xor ecx,ecx + sar ax,12-2 + test al,3 + jz @@gotpage ; neither -4 nor 4 ? + add [(data_himem bx).pageidx],ax + mov di,[(data_himem bx).pageidx] + lea di,[(data_himem bx+di).page] + mov edx,ds + shl edx,4 + lea cx,[(data_himem bx).cache] + add edx,ecx + mov eax,[di] + or eax,eax + jz @@ret + mov cx,4096 ; get page + call memcpy_imagez ; memcpy_imagez(edx,eax,ecx) +@@gotpage: + lea ax,[(data_himem bx+si).cache] + or si,[(data_himem bx).pageidx] ; !pageidx && !cacheidx + jnz @@notfirst2 + xchg ax,bx ; &first +@@notfirst2: + xchg ax,di +@@ret: + pop si + ret + + endp _prev_bufv + endif + +;=============================================================== + + ifdef NO386 + p8086 + endif + +;*************************************************************** +;_fastcall void memcpy_image_initrd(si:struct image_himem *m); +;_fastcall void memcpy_image_kernel(si:struct image_himem *m); +;_fastcall void memcpy_image(bx:struct image_himem *m); +;*************************************************************** + global @memcpy_image_initrd$qv:near +@memcpy_image_initrd$qv: + lea bx,[si+size image_himem] + db 0A9h ; test ax,imm + global @memcpy_image_kernel$qv:near +@memcpy_image_kernel$qv: + mov bx,si + proc @memcpy_image$qp11image_himem near + + ifndef NO386 + mov edx,[(image_himem bx).fallback] + mov eax,[(image_himem bx).buf] + cmp eax,edx ; if (m->fallback != m->buf) + jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) + mov ecx,[(image_himem bx).size] + else + les cx,[((image_himem bx).buf)] + mov dx,es + les ax,[((image_himem bx).fallback)] + ;cmp ax,cx ; if (m->fallback != m->buf) + ;jnz @@do + ;cmp dx,[word ((image_himem bx).fallback)+2] + ;jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) +@@do: + push [((image_himem bx).size)] + xor bx,bx +call_memcpy32: ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) + push dx ; [word ((image_himem bx).buf)+2] + push cx ; [word ((image_himem bx).buf)] + push bx + push es ; push es:ax + push ax + jmp @@memcpy + endif +memcpy_imagez: ; memcpy_imagez(edx,eax,ecx) + p386 + push ecx + push eax + push 0 + ifndef NO386 +call_memcpy32: ; call_memcpy32(to=edx,fromseg,fromofs,size) + endif + push edx + ifdef NO386 + p8086 + endif +@@memcpy: + extrn memcpy32:near + call near memcpy32 +@@skip: + ret + + global movedend:near +movedend: + + endp @memcpy_image$qp11image_himem + +;*************************************************************** +;_fastcall void storepage(di:u32 *dst); +;*************************************************************** + global @storepage$qpul:near + proc @storepage$qpul near + + ifndef NO386 + mov edx,[di] + else + les ax,[dword di] + endif + mov cx,offset _buf4k +storepage: ; storepage(edx,cx) + ifndef NO386 + push 0 + push 4096 + push 0 + push cx + push ds ; call_memcpy32(to=edx,fromseg,fromofs,size) + else + xor dx,dx + push dx ; 0 + mov bx,4096 + push bx ; 4096 + mov bx,ds ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) + endif + jmp call_memcpy32 + + endp @storepage$qpul + +;=============================================================== + +;*************************************************************** +;_fastcall void strcatb(bx:const char* a, ax:const char* b); +;*************************************************************** + global @strcatb$qpxzct1:near + proc @strcatb$qpxzct1 near + + push si + xchg ax,si ; b + dec bx +@@catlp: + inc bx + cmp [byte bx],0 ; a=bx + jne @@catlp + db 0b8h,20h ; mov ax,??20h +@@cpylp: + lodsb + mov [bx],al + inc bx + or al,al + jne @@cpylp + pop si + ret + + endp @strcatb$qpxzct1 + ends _TEXT diff -r be11ceb31dcf -r 530dacfd6585 linld/stuff/src/JUMP.ASM --- a/linld/stuff/src/JUMP.ASM Wed Dec 22 13:43:13 2021 +0100 +++ b/linld/stuff/src/JUMP.ASM Fri Dec 24 12:31:52 2021 +0000 @@ -235,8 +235,7 @@ mov eax,[dword si+1E6h] xor eax,'SKLE' else - mov ax,[si+1E6h] - xor ax,'LE' + cmp [word si+1E6h],'LE' jne @@notelks mov ax,[si+1E8h] xor ax,'SK' diff -r be11ceb31dcf -r 530dacfd6585 linld/stuff/src/_BEG.ASM --- a/linld/stuff/src/_BEG.ASM Wed Dec 22 13:43:13 2021 +0100 +++ b/linld/stuff/src/_BEG.ASM Fri Dec 24 12:31:52 2021 +0000 @@ -281,16 +281,15 @@ mov cx,0F04h and ah,ch and bh,ch - ror bx,cl ; extended FamilyID in bl, extended ModelID in bh[7-4] + rol bx,cl ; extended FamilyID in bh, extended ModelID in bl[7-4] shr al,cl ; set base ModelID cmp ah,ch jz SetModelID cmp ah,06h jnz ModelIDset - db 3Dh ; cmp ax,0E302h + mov bh,0 ; remove extended FamilyID SetModelID: - add ah,bl ; use extended FamilyID - or al,bh ; use extended ModelID + add ax,bx ; use extended FamilyID & extended ModelID ModelIDset: set_cputype: endif diff -r be11ceb31dcf -r 530dacfd6585 lzsa/receipt --- a/lzsa/receipt Wed Dec 22 13:43:13 2021 +0100 +++ b/lzsa/receipt Fri Dec 24 12:31:52 2021 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="lzsa" -VERSION="1.3.8" +VERSION="1.3.9" CATEGORY="system-tools" SHORT_DESC="Efficient packer optimized for fast decompression on 8-bit cpu." MAINTAINER="pascal.bellard@slitaz.org"