wok diff linld/stuff/src/CRTL.ASM @ rev 24020
linld: fix iso9660/64
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 06 18:15:05 2021 +0000 (2021-03-06) |
parents | 61df94a0fa43 |
children | 217c02cbbe8d |
line diff
1.1 --- a/linld/stuff/src/CRTL.ASM Sun Feb 28 16:32:57 2021 +0000 1.2 +++ b/linld/stuff/src/CRTL.ASM Sat Mar 06 18:15:05 2021 +0000 1.3 @@ -357,11 +357,8 @@ 1.4 inc bx 1.5 xchg ax,bx 1.6 or dl,dl ; clear C 1.7 - jz failifc ; return 0 1.8 + jz failifc ; return 0, bx=a tail 1.9 xor dl,[bx] ; dl -= *a++ 1.10 - ifdef BASIC_ISO9660 1.11 - and dl,0dfh ; upcase 1.12 - endif 1.13 jne fail ; return -1 1.14 inc bx 1.15 jmp @@loop 1.16 @@ -397,6 +394,9 @@ 1.17 inc bx 1.18 xchg ax,bx 1.19 xor dl,[bx] ; dl ^= *a++ 1.20 + ifndef ROCKRIDGE 1.21 + and dl,0dfh ; case insensitive 1.22 + endif 1.23 jne fail ; return -1 1.24 inc bx 1.25 or dl,dl ; clear C 1.26 @@ -747,14 +747,9 @@ 1.27 ifdef ISO9660 1.28 ifndef NO386 1.29 mov eax,[_isostate.filesize] 1.30 -@@end: 1.31 - mov [(image_himem si).chunk_size],eax 1.32 else 1.33 mov ax,[word _isostate.filesize] 1.34 mov dx,[(word _isostate.filesize)+2] 1.35 -@@end: 1.36 - mov [word (image_himem si).chunk_size],ax 1.37 - mov [word ((image_himem si).chunk_size)+2],dx 1.38 endif 1.39 else 1.40 mov bl,02h ; SEEK_END 1.41 @@ -764,8 +759,6 @@ 1.42 mov ax,[(image_himem si).fd] 1.43 call rewind 1.44 pop eax 1.45 -@@end: 1.46 - mov [(image_himem si).chunk_size],eax 1.47 else 1.48 push ax 1.49 push dx 1.50 @@ -773,11 +766,15 @@ 1.51 call rewind 1.52 pop dx 1.53 pop ax 1.54 + endif 1.55 + endif 1.56 @@end: 1.57 + ifndef NO386 1.58 + mov [(image_himem si).chunk_size],eax 1.59 + else 1.60 mov [word (image_himem si).chunk_size],ax 1.61 mov [word ((image_himem si).chunk_size)+2],dx 1.62 endif 1.63 - endif 1.64 ret 1.65 1.66 endp next_chunk 1.67 @@ -1048,16 +1045,18 @@ 1.68 proc @read_image$qp11image_himem near 1.69 1.70 push di 1.71 - mov di,4096 1.72 - push di ; original size 1.73 + xor di,di 1.74 @@loop: 1.75 ifndef NO386 1.76 - movzx ecx,di 1.77 + xor ecx,ecx 1.78 + mov ch,4096/256 1.79 + sub cx,di 1.80 mov eax,[(image_himem si).chunk_size] 1.81 cmp ecx,eax 1.82 jb @@szok 1.83 else 1.84 - mov cx,di 1.85 + mov cx,4096 1.86 + sub cx,di 1.87 mov ax,[word (image_himem si).chunk_size] 1.88 cmp cx,ax 1.89 jb @@szok 1.90 @@ -1067,49 +1066,43 @@ 1.91 xchg ax,cx 1.92 @@szok: 1.93 jcxz image_done 1.94 - mov dx,offset _xfer_buf+4096 1.95 - sub dx,di 1.96 - mov bx,[si] 1.97 + lea dx,[di+_xfer_buf] 1.98 + mov bx,[(image_himem si).fd] 1.99 call @read$cxdxbx 1.100 jb image_done 1.101 - xor cx,cx 1.102 - cwd ; ax < 8000h 1.103 + add di,ax 1.104 ifndef NO386 1.105 cwde ; ax < 8000h 1.106 + cdq 1.107 sub [(image_himem si).chunk_size],eax 1.108 - xchg eax,ebx 1.109 else 1.110 + cwd ; ax < 8000h 1.111 sub [word (image_himem si).chunk_size],ax 1.112 - xchg ax,bx 1.113 sbb [word ((image_himem si).chunk_size)+2],dx 1.114 - jnz @@fill 1.115 - cmp [word (image_himem si).chunk_size],dx 1.116 endif 1.117 - jnz @@fill 1.118 - dec cx 1.119 @@fill: 1.120 - test bl,3 1.121 + test al,3 1.122 je @@filled 1.123 - mov [bx+_xfer_buf],dh 1.124 - inc bx 1.125 + mov [di+_xfer_buf],dl 1.126 + inc di 1.127 + inc ax 1.128 jmp @@fill 1.129 @@filled: 1.130 ifndef NO386 1.131 - sub [(image_himem si).remaining],ebx 1.132 + sub [(image_himem si).remaining],eax 1.133 + or edx,[word (image_himem si).chunk_size] 1.134 else 1.135 - sub [word (image_himem si).remaining],bx 1.136 + sub [word (image_himem si).remaining],ax 1.137 sbb [word ((image_himem si).remaining)+2],dx 1.138 + mov ax,[word (image_himem si).chunk_size] 1.139 + or ax,[word ((image_himem si).chunk_size)+2] 1.140 endif 1.141 - sub di,bx 1.142 - pushf 1.143 - jcxz @@same_chunk 1.144 + jnz @@same_chunk 1.145 call next_chunk 1.146 @@same_chunk: 1.147 - popf 1.148 - jnz @@loop 1.149 + jmp @@loop 1.150 image_done: 1.151 - pop ax ; original size 1.152 - sub ax,di 1.153 + xchg ax,di 1.154 pop di 1.155 ret 1.156