# HG changeset patch # User Pascal Bellard # Date 1607794004 0 # Node ID 34d90fb03f57d1f5946522ae65993c83d5251ab5 # Parent 3d19917d3a035318ab5d8c57b748df5e95e15585 linld: hide -b= argument diff -r 3d19917d3a03 -r 34d90fb03f57 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Sat Dec 12 10:41:29 2020 +0000 +++ b/linld/stuff/src/CRTL.ASM Sat Dec 12 17:26:44 2020 +0000 @@ -393,8 +393,8 @@ ifdef USE_ARGSTR ;*************************************************************** -;_fastcall int argstr(bx:const char *s, ax:const char keywords[], dx:const char **var); -;_fastcall int argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var); +;_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); ;*************************************************************** global @argstr$qpxzcxt1ppxzc:near proc @argstr$qpxzcxt1ppxzc near @@ -404,6 +404,7 @@ global @argnum$qpzcxpxzcpul:near @argnum$qpzcxpxzcpul: mov cl,4 + push bx xchg ax,bx ; keywords -> bx xchg ax,cx ; s -> cx cbw ; argstr:0002 argnum:0004 @@ -450,22 +451,21 @@ cmp al,'=' ;je @@found ;cmp al,0 ; eos, si=next argv - stc + mov ax,-1 jne @@nokeyword @@found: - mov [di],si dec dx dec dx je @@done ;mov bx,si call @strtol$qpxzc - mov [di],ax + xchg ax,si mov [di+2],dx @@done: - clc + mov [di],si + xchg ax,di @@nokeyword: - sbb ax,ax - pop di si + pop di si bx ret endp @argstr$qpxzcxt1ppxzc diff -r 3d19917d3a03 -r 34d90fb03f57 linld/stuff/src/LINLD.CPP --- a/linld/stuff/src/LINLD.CPP Sat Dec 12 10:41:29 2020 +0000 +++ b/linld/stuff/src/LINLD.CPP Sat Dec 12 17:26:44 2020 +0000 @@ -75,12 +75,12 @@ continue; } #endif - if (argstr(*argv,"cl|image|initrd",clp) != -1 && **argv == 'c') continue; + if (argstr(*argv,"cl|image|initrd",clp) == (int) clp) continue; + if (argnum(*argv,"root|vga|mem|-b",&root_dev) == (int) &base_himem) continue; if (fileexist(*argv) != -1) { kernel_name=*argv; continue; } - argnum(*argv,"root|vga|mem|-b",&root_dev); *clp = (const char *) buf_cmdline + 1; strcatb((const char *) buf_cmdline,*argv); } diff -r 3d19917d3a03 -r 34d90fb03f57 linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Sat Dec 12 10:41:29 2020 +0000 +++ b/linld/stuff/src/pipehole.awk Sat Dec 12 17:26:44 2020 +0000 @@ -38,13 +38,15 @@ if (/image\|initrd/) islinld=3 if (islinld==3) { if (/bx,word ptr/) { print "; " $0; next } - if (/short @1@282/) print " mov bx,word ptr [si]" - if (/@fileexist\$qpxzc/) islinld=0 } if (/fileexist\$qpxzc/) islinld=4 if (islinld==4) { - if (/ax,-1/) print " mov bx,word ptr [si]" - if (/ax,word ptr/) $0=" xchg ax,bx" + if (/ax,-1/) { + print " inc ax" + print " mov ax,word ptr [si]" + next + } + if (/ax,word ptr/) next if (/\[si\]$/) { islinld=0; print "; " $0; next } } if (/buf_cmdline\+1/) { @@ -54,6 +56,7 @@ } if (islinld==5) { if (/bx,offset DGROUP:buf_cmdline/) $0=" dec bx" + if (/ax,word ptr/) next if (/call/) islinld=0 } } # file == "linld.cpp"