wok view linld/stuff/src/pipehole.awk @ rev 21758

Update icevm & obex-data-server websites
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jun 26 17:24:54 2019 +0200 (2019-06-26)
parents 2373992ff751
children 68f9518c4cb0
line source
1 BEGIN { hold=0; is386=0; isload=0; isiso=0; istazboot=0; wascall=0; label="none"; xlabel="" }
2 function isnum(n) { return match(n,/^[0-9+-]/) }
3 {
4 sub(/segment word public/,"segment byte public")
6 if (/^@.*:$/ || / endp$/) afterjmp=0
7 if (/dword ptr/) is386=1
8 sub(/DGROUP:_imgs\+65534/,"[di-2]")
9 if (/cmd_line_ptr =/ && is386 == 0) isload=7
10 if (isload == 7) { # LOAD.LST
11 if (/add/ || /xor/ || /extrn/ || /N_LXLSH@/ || /cl,4/) next
12 if (/,ax/) {
13 sub(/ax/,"8000h")
14 isload=0
15 }
16 if (/,dx/) {
17 print " mov cl,12"
18 print " shr ax,cl"
19 sub(/dx/,"ax")
20 }
21 }
22 if (/\[0\] = m-\>fallback/) isload=6
23 if (isload == 6) { # LOAD.LST
24 if (/si\+2/) {
25 print " inc si"
26 $0=" inc si"
27 }
28 if (/les/) sub(/bx,/,"ax,")
29 if (/bx\+4/ || /es:/) {
30 if (/bx\+4/) isload=0
31 next
32 }
33 if (/si\+6/) {
34 print " xchg ax,di"
35 print " movsw"
36 print " movsw"
37 print " movsw"
38 print " movsw"
39 print " xchg ax,di"
40 next
41 }
42 }
43 if (/version_string = /) isload=5
44 if (isload == 5) { # LOAD.LST
45 sub(/ax,/,"bx,")
46 if (/_version_string,/) isload=0
47 if (/mov bx,ax/) next
48 }
49 if (/topseg\(\)>>12/) isload=4
50 if (isload == 4 && is386 == 0) { # LOAD.LST
51 if (/push/ || /pop/) next
52 if (/ax,cs/) {
53 print " cwd"
54 sub(/ax,cs/,"bx,cs")
55 }
56 if (/dx,dx/) next
57 sub(/ax,dx/,"ax,bx")
58 if (/call/) isload=400
59 }
60 if (isload == 400 && /,0/) {
61 sub(/,0/,",dh")
62 isload=0
63 }
64 if (isload == 4 && is386) { # LOAD.LST
65 sub(/dx,cs/,"edx,cs")
66 sub(/eax/,"edx")
67 sub(/ax,9/,"dx,9")
68 if (/,0$/) sub(/,0/,",dh")
69 if (/movzx/) next
70 if (/fallback = base_himem/) { isload=0 }
71 }
72 if (/void load_initrd\(\)/) isload=3
73 if (isload == 3) { # LOAD.LST
74 if(/push di/ || /pop di/) next
75 sub(/\[di/,"[bx")
76 sub(/\di,/,"bx,")
77 }
78 if (/vid_mode = vid_mode/) isload=2
79 if (isload == 2) { # LOAD.LST
80 sub(/,0/,""); sub(/cmp /,"mov cx,")
81 sub(/je/,"jcxz")
82 if (/ax,word/) next
83 sub(/,ax/,",cx")
84 if (/version_string/ || /starting linux 1\.3\.73/) isload=0
85 }
86 if (/_rm_size=0x200/ || /heap_top = _rm_buf/) isload=1
87 if (isload == 1) { # LOAD.LST
88 if (/mov al,byte ptr/ && is386) {
89 print " movzx eax,byte ptr [si]"
90 next
91 }
92 if (/ax,word ptr/) next
93 if (/^ call/) isload=0
94 }
95 if (/CD001/) isiso=7
96 if (isiso == 7) { # ISO9660.LST
97 sub(/mov ax,-1/,"dec ax")
98 if (/jmp/) isiso=0
99 }
100 if (/int len =/) isiso=6
101 if (isiso == 6) { # ISO9660.LST
102 if (/dx,ax/) next
103 sub(/ax/,"dx")
104 sub(/cx,di/,"bx,di")
105 sub(/cx,dx/,"bx,ax")
106 sub(/di,dx/,"di,ax")
107 if (/while/) isiso=2
108 }
109 if (/entrysize =/) isiso=5
110 if (isiso == 5) { # ISO9660.LST
111 if (/ax,ax/) next
112 sub(/ax/,"cx")
113 sub(/je/,"jcxz")
114 if (/return/) isiso=0
115 }
116 if (/x->curdirsize == 0xFFFF/) isiso=4
117 if (isiso == 4) { # ISO9660.LST
118 sub(/DGROUP:_isostate\+18/,"[si+18]")
119 sub(/DGROUP:_isostate\+20/,"[si+20]")
120 if (/goto restarted/) isiso=0
121 }
122 if (/do s\+\+; while/) isiso=3
123 if (/for \(p = s; \*s && \*s \!=/) isiso=3
124 if (isiso == 3) { # ISO9660.LST, TAZBOOT.LST
125 sub(/cmp byte ptr \[.i\]/,"sub al")
126 if (/mov byte ptr \[bp-5\],al/) $0=" push ax"
127 if (/mov al,byte ptr \[bp-5\]/) $0=" pop ax"
128 if (/inc /) { r=$2; print; next }
129 if (/al,0/) print " mov al,[" r "]"
130 if (/al,byte ptr/) sub(/mov/,"xchg")
131 if (/byte ptr \[.*\],0/) next
132 if (/jmp/) print " mov bx,si"
133 if (/word ptr \[bp-4\]/) next
134 if (/\) s\+\+;/ || /\],-1/) isiso=0
135 }
136 if (/endname = NULL/) isiso=2
137 if (isiso == 2) { # ISO9660.LST
138 if (/mov bx,cx/) next
139 gsub(/cx/,"bx")
140 sub(/DGROUP:_isostate\+35/,"[si+35]")
141 }
142 if (/const char \*n = name/) isiso=1
143 if (isiso == 1) { # ISO9660.LST
144 if ((/mov word ptr \[si\+32\],ax/ ) ||
145 (/mov ax,word ptr \[si\+2\]/) ||
146 (/bx,word ptr \[si\+32\]/) || (/ax,dx/)) next
147 if (/dx,/) sub(/dx/,"ax")
148 if ((/sub ax,word ptr \[si\+2\]/) ||
149 (/\[si\+16\]/) || (/ax,di/)) sub(/ax/,"bx")
150 if (/add word ptr \[si\+32\],ax/) $0=" add bx,word ptr [si+16]"
151 if (/al,/ || /,al/) sub(/al/,"cl")
152 if (/cmp byte ptr \[si\+34\],0/) $0=" or cl,cl"
153 if (/jne @@0$/) next
154 if (/jmp @3@58$/) $0=" je @3@58"
155 sub(/mov ax,-1/,"dec ax")
156 }
157 if (/endp/) { xlabel = ""; goto2=0 }
158 if (/isoopen\(s\+7\)/ && xlabel == "") goto2=1
159 if (/_vid_mode,ax/ && xlabel == "") goto2=1
160 if (/_base_himem\+2,/ && xlabel == "@") goto2=1
161 if (/puts\(cmdline\)/ && xlabel == "@@") goto2=1
162 if (goto2 == 1 && /jmp/) { # TAZBOOT.LST && LINLD.LST
163 print $NF xlabel "@:"
164 label=$NF
165 }
166 if (goto2 > 0 && label == $NF) {
167 $0=$0 xlabel
168 if (goto2++ == 1) xlabel=xlabel "@"
169 }
170 if (/cmdline=s\+=3/ || /magic \!= 0/ || /&root_dev =/) { isotazboot=10; j="" }
171 if (isotazboot == 10) { # TAZBOOT.LST && LINLD.LST
172 if (/je/ || /jne/) { j=$1; next }
173 if (/jmp/) {
174 if (j=="jne") sub(/jmp/,"je")
175 else if (j=="je") sub(/jmp/,"jne")
176 isotazboot=0
177 }
178 }
179 if (/static const unsigned long initrddesc = 18L/) isotazboot=9
180 if (isotazboot == 9) { # TAZBOOT.LST
181 if (/,0/) {
182 split($4,y,",")
183 print " mov bx,offset " y[1]
184 }
185 if (/DGROUP:.*\+6,46/) {
186 sub(/DGROUP:.*\+6,/,"[bx+6],")
187 isotazboot=0
188 }
189 if (/mov/) $0=" mov si,bx"
190 sub(/DGROUP:.*,/,"[bx],")
191 }
192 if (/isoopen\(s\+7\) != -1/) isotazboot=8
193 if (isotazboot == 8) { # TAZBOOT.LST
194 if (/ax,si/) next
195 sub(/ax,ax/,"si,si")
196 if (/magic/) isotazboot=0
197 }
198 if (/\+\+isknoppix/) isotazboot=7
199 if (isotazboot == 7) { # TAZBOOT.LST
200 if (/al,byte/) sub (/al,byte ptr DGROUP:/,"bx,offset ")
201 if (/inc/) sub (/al/,"word ptr [bx]")
202 if (/,al/) next
203 if (/isokernel/) isotazboot=0
204 }
205 if (/if \(c\) s\+\+;/) isotazboot=6
206 if (isotazboot == 6) { # TAZBOOT.LST
207 if (/cmp/) {
208 $0=" cmp al,0"
209 isotazboot=0
210 }
211 }
212 if (/static void next_chunk/) isotazboot=5
213 if (isotazboot == 5 || isotazboot == 500) { # TAZBOOT.LST
214 if (/cx,ax/) $0=" xchg ax,bx"
215 if (/ax,word ptr \[si\+28\]/ && isotazboot == 500) next
216 if (/bx,cx/) next
217 if (/push/ || /pop/ || /bp,sp/ || /si,/) next
218 sub(/\[si/,"[di")
219 if (/initrd_info/) isotazboot=500
220 if (/endp/) isotazboot=0
221 }
222 if (/0x7FF0/) isotazboot=4
223 if (isotazboot == 4) { # TAZBOOT.LST
224 if (/ax,word ptr/) {
225 print " mov ax,32752"
226 print " cwd"
227 sub(/mov/,"sub")
228 }
229 if (/bx,/ || /cx,/ || /dx,/) next
230 sub(/,0/,",dx")
231 sub(/,bx/,",dx")
232 sub(/,cx/,",ax")
233 if (/@addinitrd\$qv/) isotazboot=0
234 }
235 if (/c = x->filename/) isotazboot=3
236 if (isotazboot == 3) { # TAZBOOT.LST
237 if (/ax,/) $0=" xchg ax,bx"
238 if (/\]$/) next
239 if (/@strcpy\$qpxzct1/) isotazboot=0
240 }
241 if (/base_himem = memtop/) isotazboot=2
242 if (isotazboot == 2) { # TAZBOOT.LST
243 if (/@6@226/ || /mov ax,1/ || /@6@254/ || /xor ax,ax/) next
244 if (/word ptr \[bx\+2\],0/) {
245 print s; hold=0
246 print " mov bx,word ptr [bx+2]"
247 $0=" or bx,bx"
248 }
249 if (/\[bp-4\],ax/) sub(/ax/,"bx")
250 if (/ax,word ptr \[bx\+2\]/ || /bx,ax/) next
251 if (/@strcmp\$qpxzct1/) isotazboot=0
252 }
253 if (/static void addinitrd/) isotazboot=100
254 if (isotazboot == 100) { # TAZBOOT.LST
255 if (/cx,ax/) {
256 print " mov si,offset _isostate+8"
257 print " push ds"
258 print " pop es"
259 print " xchg ax,di"
260 print " movsw"
261 print " movsw"
262 print " movsw"
263 print " movsw"
264 $0=" xchg ax,di"
265 }
266 if (/mov/ && !/si/ && !/cl/) next
267 if (/void load_initrds/) isotazboot=101
268 }
269 if (isotazboot == 101 || isotazboot == 102) { # TAZBOOT.LST
270 sub(/\[si/,"[di"); sub(/si,/,"di,"); sub(/si$/,"di")
271 sub(/DGROUP:_imgs\+38$/,"[di+38-32]")
272 sub(/DGROUP:_imgs\+40$/,"[di+40-32]")
273 if (/isofd/) isotazboot=102
274 if (/push/ && isotazboot == 102) next
275 if (/pop/ && isotazboot == 102) next
276 if (/load_initrd/) isotazboot=101
277 if (/isokernel/) isotazboot=103
278 }
279 if (isotazboot > 102) { # TAZBOOT.LST
280 if (/push/ || /pop/) next
281 sub(/\[si/,"[bx")
282 sub(/si,/,"bx,")
283 if (/static void bootiso/) isotazboot=0
284 }
285 if (wascall) {
286 if (rcall != "") {
287 if (/,ax$/) print " mov " rcall ",ax"
288 else print " xchg ax," rcall
289 wascall=0
290 }
291 else if (/^ mov .i,ax$/) {
292 split($2,y,",")
293 rcall=y[1]
294 next
295 }
296 else wascall=0
297 }
298 if (/^ call /) { wascall=1; rcall="" }
299 if (hold == 0) {
300 s=$0
301 if (/^ mov .[ix],bx$/ || /^ mov .[ix],.i$/) {
302 r=$2; kept=0
303 hold=1; split($2,regs,","); next
304 }
305 if (/^ inc e?.[ixhl]/ || /^ dec e?.[ixhl]/) {
306 hold=2; r=$2; next
307 }
308 if (/^ mov [abcds][ix],/ && ! /,.s/) {
309 hold=3; split($2,regs,","); next
310 }
311 if (/^ movzx eax,ax$/) { hold=4; next }
312 if (/^ cmp word ptr/ || /^ cmp [bcd]x,/) {
313 split($0,regs,",")
314 if (isnum(regs[2]) && regs[2] != 0 &&
315 (regs[2] % 256) == 0) {
316 hold=5; next
317 }
318 }
319 if (/^ mov ax,cs$/) { hold=6; kept=0; next }
320 if (/^ mov cl,4$/) { hold=7; next }
321 if (/^ cmp word ptr DGROUP:.*,0$/) {
322 hold=8; split($2,regs,","); next
323 }
324 if (/^ cbw/) { hold=11; kept=0; next }
325 if (/^ add [abcds][ix],2$/) {
326 split($2,regs,","); hold=12; next
327 }
328 if (/^ sub [abcds][ix],2$/) {
329 split($2,regs,","); hold=13; next
330 }
331 if (/^ push dx$/) {
332 hold=14; next;
333 }
334 }
335 else if (hold == 1) {
336 if (/^ ;/) { line[kept++]=$0; next }
337 hold=0; split($2,args,","); op=""
338 if ($1 == "add") op="+"
339 if ($1 == "sub") op="-"
340 if ($1 == "inc") { op="+"; args[2]="1"; }
341 if ($1 == "dec") { op="-"; args[2]="1"; }
342 if (op != "" && regs[1] == args[1]) {
343 if (isnum(args[2])) {
344 for (i = kept++; i > 0; i--) line[i] = line[i-1]
345 line[0] = "\tlea\t" regs[1] ",[" regs[2] op args[2] "]"
346 hold=10; next
347 }
348 line[kept++]=$0
349 hold=1
350 next
351 }
352 if (/^ pop [ds]i/ && regs[2] ~ /^[ds]i$/) {
353 print " xchg " r
354 }
355 else print s
356 for (i = 0; i < kept; i++) print line[i]; kept=0
357 }
358 else if (hold == 2) {
359 split($0,args,",")
360 if (/^ mov / && r == args[2]) { print s; s=$0; next }
361 split($2,args,",")
362 hold=0; print s
363 if ($1 == "or" && r == args[1] && r == args[2]) next # don't clear C ...
364 }
365 else if (hold == 3) {
366 hold=0
367 if (/^ call / && regs[2] == "ax") s=" xchg ax," regs[1]
368 if (/^ add [abcds][ix],/) {
369 split($2,regs2,",")
370 if (regs[1] == regs2[1] && (regs2[2] == "offset" || isnum(regs2[2]))) {
371 t=$0; sub(/mov/,$1,s); sub(/add/,"mov",t)
372 print t; print s; next
373 }
374 }
375 print s
376 }
377 else if (hold == 4) {
378 hold=0
379 if (/^ push eax$/) {
380 print " push 0"; print " push ax"; next
381 } else { print s }
382 }
383 else if (hold == 5) {
384 hold=0
385 if ($1 == "jae" || $1 == "jb") {
386 sub(/word ptr/,"byte ptr",s); sub(/x,/,"h,",s) ||
387 sub(/\],/,"+1],",s) || sub(/,/,"+1,",s)
388 s = s "/256"
389 }
390 print s
391 }
392 else if (hold == 6) {
393 if (($1 == "and" || $1 == "add") && $2 ~ /^ax,/) {
394 line[kept++]=$0
395 next
396 }
397 p=$0
398 if (/^ movzx eax,ax$/) {
399 s=" mov eax,cs"; p=""
400 }
401 print s
402 for (i = 0; i < kept; i++) print line[i]; kept=0
403 if (p != "") print p
404 hold=0; next
405 }
406 else if (hold == 7) {
407 hold=0
408 if (/^ call near ptr N_LXURSH@$/) {
409 print " extrn N_LXURSH@4:near"
410 print " call near ptr N_LXURSH@4"
411 next
412 }
413 if (/^ call near ptr N_LXLSH@$/) {
414 print " extrn N_LXLSH@4:near"
415 print " call near ptr N_LXLSH@4"
416 next
417 }
418 print s
419 }
420 else if (hold == 8) {
421 if ($1 == "je" || $1 == "jne") { p=$0; hold=9; next }
422 hold=0
423 print s
424 }
425 else if (hold == 9) {
426 hold=0; split($2,args,",")
427 if (/^ mov ax,/ && args[2] == regs[1]) {
428 print; print " or ax,ax"; print p; next
429 }
430 print s; print p;
431 }
432 else if (hold == 10) {
433 split($2,args,","); op=""
434 if ($1 == "add") op="+"
435 if ($1 == "sub") op="-"
436 if ($1 == "inc") { op="+"; args[2]="1"; }
437 if ($1 == "dec") { op="-"; args[2]="1"; }
438 if (op != "" && isnum(args[2])) {
439 split(line[0],reg,",")
440 if (substr(reg[1],length(reg[1])-1,2) == args[1]) {
441 line[0] = substr(line[0],1,length(line[0])-1) op args[2] "]"
442 next
443 }
444 }
445 hold=0
446 if (/^ mov [sd]i,ax$/) {
447 split($2,args,",")
448 for (i = 0; i < kept; i++) {
449 sub(/ax/,args[1],line[i]); print line[i]
450 }
451 next
452 }
453 for (i = 0; i < kept; i++) print line[i]
454 }
455 else if (hold == 11) {
456 if (/^ inc ax$/ || /^ dec ax$/) {
457 line[kept++]=$0; next
458 }
459 split($2,args,",")
460 if (/^ mov cl,/) {
461 split($2,args,",")
462 if (args[2] >= 8) {
463 line[kept++]=$0; next
464 }
465 }
466 if (!/^ shl ax,/ || (args[2] != "cl" && args[2] < 8)) {
467 print " cbw "
468 }
469 for (i = 0; i < kept; i++) print line[i]
470 hold=kept=0
471 }
472 else if (hold == 12) {
473 hold=0
474 if ($1 != "adc" && $1 != "sbb" && ! /^ jn?[abc]/) {
475 print " inc " regs[1]
476 print " inc " regs[1]
477 }
478 else print " add " regs[1] ",2"
479 }
480 else if (hold == 13) {
481 hold=0
482 if ($1 != "adc" && $1 != "sbb" && ! /^ jn?[abc]/) {
483 print " dec " regs[1]
484 print " dec " regs[1]
485 }
486 else print " sub " regs[1] ",2"
487 }
488 else if (hold == 14) {
489 if (/^ push ax$/) { hold++; next; }
490 print " push dx";
491 hold=0;
492 }
493 else if (hold == 15) {
494 if (/^ pop eax$/) { hold++; next; }
495 print " push dx";
496 print " push ax";
497 hold=0;
498 }
499 else if (hold == 16) {
500 hold=0;
501 if (/^ shr eax,16$/) { print " xchg ax,dx"; next; }
502 print " push dx";
503 print " push ax";
504 print " pop eax";
505 }
506 else if (hold == 17) {
507 hold=0;
508 if (/^ cmp ax,-1$/) { print " inc ax"; next; }
509 }
510 if (/^ call near ptr @fileexist\$/ || # return boolean :
511 /^ call near ptr @isoreaddir\$/ || # 0=true, -1=false
512 /^ call near ptr @isoreset\$/ ||
513 /^ call near ptr @isoopen\$/ ||
514 /^ call near ptr @isoreadsector\$/ ||
515 /^ call near ptr @strhead\$/ ||
516 /^ call near ptr @argstr\$/ ||
517 /^ call near ptr @argnum\$/) { print; hold=17; next; }
518 s=$0
519 # These optimisation may break ZF or CF
520 if (/^ sub sp,2$/) { print " push ax"; next }
521 if (/^ sub sp,4$/) { print " push ax"; print " push ax"; next }
522 if (/^ add sp,4$/) { print " pop cx"; print " pop cx"; next }
523 if (/^ mov d*word ptr .*,0$/ || /^ mov dword ptr .*,large 0$/) {
524 sub(/mov/,"and",s); print s; next # slower
525 }
526 if (/^ mov d*word ptr .*,-1$/ || /^ mov dword ptr .*,large -1$/) {
527 sub(/mov/,"or",s); print s; next # slower
528 }
529 if (/^ or .*,0$/ || /^ and .*,-1$/) next
530 if (/^ or [abcd]x,/) {
531 split($2,args,",")
532 if (isnum(args[2]) && args[2] >= 0 && args[2] < 256) {
533 print " or " substr(args[1],1,1) "l," args[2]; next
534 }
535 }
536 if (/^ and [abcd]x,/) {
537 split($2,args,",")
538 if (isnum(args[2]) && args[2] >= -256 && args[2] < 0) {
539 print " and " substr(args[1],1,1) "l," args[2]; next
540 }
541 }
542 if (/^ or e[abcd]x,/) {
543 split($2,args,",")
544 if (args[2] == "large") { args[2] = $3 }
545 if (isnum(args[2]) && args[2] >= 0 && args[2] < 256) {
546 print " or " substr(args[1],2,1) "l," args[2]; next
547 }
548 }
549 if (/^ and e[abcd]x,/) {
550 split($2,args,",")
551 if (args[2] == "large") { args[2] = $3 }
552 if (isnum(args[2]) && args[2] >= -256 && args[2] < 0) {
553 print " and " substr(args[1],2,1) "l," args[2]; next
554 }
555 }
556 if (/^ or e[abcds][ix],/) {
557 split($2,args,",")
558 if (args[2] == "large") { args[2] = $3 }
559 if (isnum(args[2]) && args[2] >= 0 && args[2] < 65536) {
560 print " or " substr(args[1],2) "," args[2]; next
561 }
562 }
563 if (/^ and e[abcds][ix],/) {
564 split($2,args,",")
565 if (args[2] == "large") { args[2] = $3 }
566 if (isnum(args[2]) && args[2] >= -65536 && args[2] < 0) {
567 print " and " substr(args[1],2) "," args[2]; next
568 }
569 }
570 if (/^ add word ptr/ || /^ sub word ptr/ ||
571 /^ add [bcd]x,/ || /^ sub [bcd]x,/) {
572 split($0,args,",")
573 if (isnum(args[2]) && (args[2] % 256 == 0)) {
574 sub(/word ptr/,"byte ptr",s); sub(/x,/,"h,",s) ||
575 sub(/\],/,"+1],",s) || sub(/,/,"+1,",s)
576 print s "/256"; next
577 }
578 }
579 if (/^ add dword ptr/ || /^ sub dword ptr/) {
580 split($0,args,",")
581 if (args[2] == "large") { args[2] = $3 }
582 if (isnum(args[2])) {
583 if (args[2] % 16777216 == 0) {
584 sub(/dword/,"byte",s)
585 sub(/\],/,"+3],",s) || sub(/,/,"+3,",s)
586 print s "/16777216"; next
587 }
588 if (args[2] % 65536 == 0) {
589 sub(/dword/,"word",s)
590 sub(/\],/,"+2],",s) || sub(/,/,"+2,",s)
591 print s "/65536"; next
592 }
593 }
594 }
595 if (/^ mov e.x,/) {
596 split($2,args,",")
597 r=args[1]
598 if (args[2] == "large") { args[2] = $3 }
599 if (isnum(args[2]) && args[2] % 65536 == args[2]) {
600 if (args[2] % 256 == args[2] || args[2] % 256 == 0) {
601 print " xor " r "," r
602 if (args[2] == 0) next
603 x=" mov " substr(r,2,1)
604 if (args[2] % 256 == 0) {
605 print x "h," args[2] "/256"
606 }
607 else { print x "l," args[2] }
608 next
609 }
610 }
611 }
612 if (afterjmp) print ";" $0
613 else print
614 if (/^ jmp / || /^ call near ptr _boot_kernel/ ||
615 /^ call near ptr @die$qpxzc/) afterjmp=1
616 }