wok-current diff linld/stuff/src/CRTL.ASM @ rev 19636
linld: check asm instructions again processor type
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 20 09:55:25 2017 +0100 (2017-01-20) |
parents | 38eb1fe036b4 |
children | 6f494adb2c71 |
line diff
1.1 --- a/linld/stuff/src/CRTL.ASM Mon Jan 16 10:15:15 2017 +0100 1.2 +++ b/linld/stuff/src/CRTL.ASM Fri Jan 20 09:55:25 2017 +0100 1.3 @@ -5,7 +5,11 @@ 1.4 %crefref 1.5 %noincl 1.6 %nomacs 1.7 + ifdef NO386 1.8 + p8086 1.9 + else 1.10 p386 1.11 + endif 1.12 1.13 group DGROUP _TEXT,_DATA,_BSS 1.14 assume cs:DGROUP,ds:DGROUP 1.15 @@ -400,6 +404,72 @@ 1.16 fd2close dw ? ;30 u16 fd2close; 1.17 ends ;}; 1.18 1.19 +;*************************************************************** 1.20 +;void next_chunk(struct image_himem *di); 1.21 +;*************************************************************** 1.22 + proc next_chunk near 1.23 + 1.24 + push si 1.25 + mov bx,[(image_himem di).fd] 1.26 + call close 1.27 + ifndef NO386 1.28 + xor eax,eax 1.29 + else 1.30 + xor ax,ax 1.31 + endif 1.32 + cwd 1.33 + mov [(image_himem di).fd],ax 1.34 + mov bx,[(image_himem di).state] 1.35 + cmp al,[bx] ; "" 1.36 + jz @@end 1.37 + mov si,bx 1.38 +@@scan: 1.39 + lodsb 1.40 + mov cx,si 1.41 + cmp al,',' 1.42 + jz @@eos 1.43 + cmp al,0 1.44 + jnz @@scan 1.45 + dec cx 1.46 +@@eos: 1.47 + mov [(image_himem di).state],cx 1.48 + dec si 1.49 + push [word si] 1.50 + mov [byte si],dl ; set temp eos 1.51 + call open 1.52 + pop [word si] ; restore string 1.53 + jc @@die 1.54 + mov [(image_himem di).fd],ax 1.55 + mov [(image_himem di).fd2close],ax 1.56 + xchg ax,bx 1.57 + mov ax,4202h ; SEEK_END 1.58 + call lseek0 1.59 +@@die: 1.60 + mov bx,[(image_himem di).errmsg] 1.61 + jc die 1.62 + mov bx,[(image_himem di).fd] 1.63 + ifndef NO386 1.64 + push eax 1.65 + call rewind 1.66 + pop eax 1.67 +@@end: 1.68 + mov [(image_himem di).chunk_size],eax 1.69 + else 1.70 + push ax 1.71 + push dx 1.72 + call rewind 1.73 + pop dx 1.74 + pop ax 1.75 +@@end: 1.76 + mov [word (image_himem di).chunk_size],ax 1.77 + mov [word ((image_himem di).chunk_size)+2],dx 1.78 + endif 1.79 + pop si 1.80 + ret 1.81 + 1.82 + endp next_chunk 1.83 + 1.84 + 1.85 ifdef LARGE_IMAGES 1.86 struc data_himem ;struct data_himem { 1.87 first dd ? ; 0 u32 first; 1.88 @@ -416,6 +486,7 @@ 1.89 global _malloc_bufv_or_die:near 1.90 proc _malloc_bufv_or_die near 1.91 1.92 + p386 1.93 pop bx ;caller return address 1.94 pop ax 1.95 push ax 1.96 @@ -526,6 +597,9 @@ 1.97 endif 1.98 pop si 1.99 ret 1.100 + ifdef NO386 1.101 + p8086 1.102 + endif 1.103 1.104 endp _malloc_bufv_or_die 1.105 1.106 @@ -577,10 +651,14 @@ 1.107 ifdef LARGE_IMAGES 1.108 jmp @@memcpy 1.109 memcpy_imagez: 1.110 + p386 1.111 push ecx 1.112 push eax 1.113 push 0 1.114 push edx 1.115 + ifdef NO386 1.116 + p8086 1.117 + endif 1.118 endif 1.119 endif 1.120 @@memcpy: 1.121 @@ -631,6 +709,7 @@ 1.122 1.123 1.124 ifdef LARGE_IMAGES 1.125 + p386 1.126 ;*************************************************************** 1.127 ;void reset_bufv(u32 *p); 1.128 ;*************************************************************** 1.129 @@ -702,78 +781,15 @@ 1.130 @@notfirst2: 1.131 pop si 1.132 ret 1.133 + ifdef NO386 1.134 + p8086 1.135 + endif 1.136 1.137 endp _prev_bufv 1.138 endif 1.139 1.140 1.141 ;*************************************************************** 1.142 -;void next_chunk(struct image_himem *di); 1.143 -;*************************************************************** 1.144 - proc next_chunk near 1.145 - 1.146 - push si 1.147 - mov bx,[(image_himem di).fd] 1.148 - call close 1.149 - ifndef NO386 1.150 - xor eax,eax 1.151 - else 1.152 - xor ax,ax 1.153 - endif 1.154 - cwd 1.155 - mov [(image_himem di).fd],ax 1.156 - mov bx,[(image_himem di).state] 1.157 - cmp al,[bx] ; "" 1.158 - jz @@end 1.159 - mov si,bx 1.160 -@@scan: 1.161 - lodsb 1.162 - mov cx,si 1.163 - cmp al,',' 1.164 - jz @@eos 1.165 - cmp al,0 1.166 - jnz @@scan 1.167 - dec cx 1.168 -@@eos: 1.169 - mov [(image_himem di).state],cx 1.170 - dec si 1.171 - push [word si] 1.172 - mov [byte si],dl ; set temp eos 1.173 - call open 1.174 - pop [word si] ; restore string 1.175 - jc @@die 1.176 - mov [(image_himem di).fd],ax 1.177 - mov [(image_himem di).fd2close],ax 1.178 - xchg ax,bx 1.179 - mov ax,4202h ; SEEK_END 1.180 - call lseek0 1.181 -@@die: 1.182 - mov bx,[(image_himem di).errmsg] 1.183 - jc die 1.184 - mov bx,[(image_himem di).fd] 1.185 - ifndef NO386 1.186 - push eax 1.187 - call rewind 1.188 - pop eax 1.189 -@@end: 1.190 - mov [(image_himem di).chunk_size],eax 1.191 - else 1.192 - push ax 1.193 - push dx 1.194 - call rewind 1.195 - pop dx 1.196 - pop ax 1.197 -@@end: 1.198 - mov [word (image_himem di).chunk_size],ax 1.199 - mov [word ((image_himem di).chunk_size)+2],dx 1.200 - endif 1.201 - pop si 1.202 - ret 1.203 - 1.204 - endp next_chunk 1.205 - 1.206 - 1.207 -;*************************************************************** 1.208 ;void open_image(const char *name, struct image_himem *m); 1.209 ;*************************************************************** 1.210 global _open_image:near