pci: don't do sanity check for missing pci bus, the check can misfire.
[minix.git] / commands / dis88 / dishand.c
blob56c63210d50bb0343fab29a1ae038d3b168ab7c3
1 static char *sccsid =
2 "@(#) dishand.c, Ver. 2.1 created 00:00:00 87/09/01";
4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5 * *
6 * Copyright (C) 1987 G. M. Harding, all rights reserved *
7 * *
8 * Permission to copy and redistribute is hereby granted, *
9 * provided full source code, with all copyright notices, *
10 * accompanies any redistribution. *
11 * *
12 * This file contains the source code for most of the spe- *
13 * cialized handler routines of the disassembler program. *
14 * (The file disfp.c contains handler routines specific to *
15 * the 8087 numeric co-processor.) Each handler routine *
16 * interprets the opcode byte (and subsequent data bytes, *
17 * if any) of a particular family of opcodes, and is re- *
18 * sponsible for generating appropriate output. All of the *
19 * code in this file is highly MACHINE-SPECIFIC, and would *
20 * have to be rewritten for a different CPU. The handler *
21 * routines are accessed only via pointers in the optab[] *
22 * array, however, so machine dependencies are confined to *
23 * this file, its sister file "disfp.c", and the data file *
24 * "distabs.c". *
25 * *
26 * All of the code in this file is based on the assumption *
27 * of sixteen-bit integers. *
28 * *
29 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
31 #include "dis.h" /* Disassembler declarations */
33 int segflg; /* Segment-override flag */
35 unsigned char objbuf[OBJMAX]; /* Buffer for object code */
37 int objptr; /* Index into objbuf[] */
39 unsigned long PC; /* Current program counter */
41 /* * * * * * MISCELLANEOUS SUPPORTING ROUTINES * * * * * */
44 void
45 objini(j) /* Object code init routine */
47 register int j;
50 if ((segflg == 1) || (segflg == 2))
51 segflg *= 3;
52 else
53 segflg = 0;
54 objptr = 0;
55 objbuf[objptr++] = (unsigned char)(j);
59 void
60 objout() /* Object-code output routine */
63 register int k;
65 if ( ! objflg )
66 return;
67 else
69 printf("\t|");
70 if (symptr >= 0)
71 printf(" %05.5lx:",(PC + 1L - (long)(objptr)));
72 for (k = 0; k < objptr; ++k)
73 printf(" %02.2x",objbuf[k]);
74 putchar('\n');
79 void
80 badseq(j,k) /* Invalid-sequence routine */
82 register int j, k;
85 printf("\t.byte\t0x%02.2x\t\t| invalid code sequence\n",j);
86 printf("\t.byte\t0x%02.2x\n",k);
89 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
90 * *
91 * This routine is the first of several opcode-specific *
92 * handlers, each of which is dedicated to a particular *
93 * opcode family. A pointer to a handler routine is con- *
94 * tained in the second field of each optab[] entry. The *
95 * dfhand() routine is the default handler, invoked when *
96 * no other handler is appropriate (generally, when an in- *
97 * valid opcode is encountered). *
98 * *
99 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
101 void
102 dfhand(j)
104 register int j; /* Pointer to optab[] entry */
106 {/* * * * * * * * * * START OF dfhand() * * * * * * * * * */
108 segflg = 0;
110 printf("\t.byte\t0x%02.2x",j);
112 if (optab[j].min || optab[j].max)
113 putchar('\n');
114 else
115 printf("\t\t| unimplemented opcode\n");
117 }/* * * * * * * * * * * END OF dfhand() * * * * * * * * * * */
119 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
121 * This is the single-byte handler, invoked whenever a *
122 * one-byte opcode is encountered. *
124 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
126 void
127 sbhand(j)
129 register int j; /* Pointer to optab[] entry */
131 {/* * * * * * * * * * START OF sbhand() * * * * * * * * * */
133 objini(j);
135 if (j == 0x2e) /* seg cs */
136 segflg = 1;
138 if ((j == 0x26) /* seg es */
139 || (j == 0x36) /* seg ss */
140 || (j == 0x3e)) /* seg ds */
141 segflg = 2;
143 printf("%s\n",optab[j].text);
145 objout();
147 }/* * * * * * * * * * * END OF sbhand() * * * * * * * * * * */
149 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
151 * This is the handler for most of the processor's regular *
152 * arithmetic operations. *
154 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
156 void
157 aohand(j)
159 register int j; /* Pointer to optab[] entry */
161 {/* * * * * * * * * * START OF aohand() * * * * * * * * * */
163 register int k;
164 int m, n;
165 char b[64];
167 objini(j);
169 switch (j & 7)
171 case 0 :
172 case 1 :
173 case 2 :
174 case 3 :
175 printf("%s\t",optab[j].text);
176 FETCH(k);
177 printf("%s\n",mtrans(j,k,TR_STD));
178 break;
179 case 4 :
180 FETCH(k);
181 printf("%s\tal,*0x%02.2x\n",optab[j].text,k);
182 break;
183 case 5 :
184 FETCH(m);
185 FETCH(n);
186 k = (n << 8) | m;
187 if (lookext((long)(k),(PC - 1),b))
188 printf("%s\tax,#%s\n",optab[j].text,b);
189 else
190 printf("%s\tax,#0x%04.4x\n",optab[j].text,k);
191 break;
192 default :
193 dfhand(j);
194 break;
197 objout();
199 }/* * * * * * * * * * * END OF aohand() * * * * * * * * * * */
201 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
203 * This is the handler for opcodes which perform short *
204 * (eight-bit) relative jumps. *
206 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
208 void
209 sjhand(j)
211 register int j; /* Pointer to optab[] entry */
213 {/* * * * * * * * * * START OF sjhand() * * * * * * * * * */
215 register int k;
216 int m;
218 objini(j);
220 FETCH(m);
222 if (m & 0x80)
223 k = 0xff00;
224 else
225 k = 0;
227 k |= m;
229 printf("%s\t%s\t\t| loc %05.5lx\n",optab[j].text,
230 lookup((PC + k + 1L),N_TEXT,LOOK_REL,-1L),
231 (PC + k + 1L));
233 objout();
235 }/* * * * * * * * * * * END OF sjhand() * * * * * * * * * * */
237 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
239 * This is the handler for a loosely-knit family of op- *
240 * codes which perform arithmetic and logical operations, *
241 * and which take immediate data. The routine's logic is *
242 * rather complex, so, in an effort to avoid additional *
243 * complexity, the search for external references in the *
244 * relocation table has been dispensed with. Eager hackers *
245 * can try their hand at coding such a search. *
247 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
249 void
250 imhand(j)
252 register int j; /* Pointer to optab[] entry */
254 {/* * * * * * * * * * START OF imhand() * * * * * * * * * */
256 unsigned long pc;
257 register int k;
258 int offset, oflag, immed, iflag, mod, opi, w, rm;
259 int m, n;
260 static char a[100], b[30];
262 objini(j);
264 FETCH(k);
266 pc = PC + 1;
268 offset = 0;
269 mod = (k & 0xc0) >> 6;
270 opi = (k & 0x38) >> 3;
271 w = j & 1;
272 rm = k & 7;
274 if ((j & 2)
275 && ((opi == 1)
276 || (opi == 4)
277 || (opi == 6)))
279 badseq(j,k);
280 return;
283 strcpy(a,OPFAM[opi]);
285 if ( ! w )
286 strcat(a,"b");
288 if ((oflag = mod) > 2)
289 oflag = 0;
291 if ((mod == 0) && (rm == 6))
293 FETCH(m);
294 FETCH(n);
295 offset = (n << 8) | m;
297 else if (oflag)
298 if (oflag == 2)
300 FETCH(m);
301 FETCH(n);
302 offset = (n << 8) | m;
304 else
306 FETCH(m);
307 if (m & 0x80)
308 n = 0xff00;
309 else
310 n = 0;
311 offset = n | m;
314 switch (j & 3)
316 case 0 :
317 case 2 :
318 FETCH(immed);
319 iflag = 0;
320 break;
321 case 1 :
322 FETCH(m);
323 FETCH(n);
324 immed = (n << 8) | m;
325 iflag = 1;
326 break;
327 case 3 :
328 FETCH(immed);
329 if (immed & 0x80)
330 immed &= 0xff00;
331 iflag = 0;
332 break;
335 strcat(a,"\t");
337 switch (mod)
339 case 0 :
340 if (rm == 6)
341 strcat(a,
342 lookup((long)(offset),N_DATA,LOOK_ABS,pc));
343 else
345 sprintf(b,"(%s)",REGS0[rm]);
346 strcat(a,b);
348 break;
349 case 1 :
350 case 2 :
351 if (mod == 1)
352 strcat(a,"*");
353 else
354 strcat(a,"#");
355 sprintf(b,"%d(",offset);
356 strcat(a,b);
357 strcat(a,REGS1[rm]);
358 strcat(a,")");
359 break;
360 case 3 :
361 strcat(a,REGS[(w << 3) | rm]);
362 break;
365 strcat(a,",");
366 if (iflag)
367 strcat(a,"#");
368 else
369 strcat(a,"*");
370 sprintf(b,"%d",immed);
371 strcat(a,b);
373 printf("%s\n",a);
375 objout();
377 }/* * * * * * * * * * * END OF imhand() * * * * * * * * * * */
379 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
381 * This is the handler for various "mov"-type opcodes *
382 * which use the mod, reg, and r/m fields of the second *
383 * code byte in a standard, straightforward way. *
385 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
387 void
388 mvhand(j)
390 int j; /* Pointer to optab[] entry */
392 {/* * * * * * * * * * START OF mvhand() * * * * * * * * * */
394 register int k, m = j;
396 objini(j);
398 FETCH(k);
400 if ((m == 0x84) || (m == 0x85) /* Kind of kludgey */
401 || (m == 0xc4) || (m == 0xc5)
402 || (m == 0x8d))
403 if (m & 0x40)
404 m |= 0x03;
405 else
406 m |= 0x02;
408 printf("%s\t%s\n",optab[j].text,mtrans(m,k,TR_STD));
410 objout();
412 }/* * * * * * * * * * * END OF mvhand() * * * * * * * * * * */
414 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
416 * This is the handler for segment-register "mov" opcodes. *
418 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
420 void
421 mshand(j)
423 register int j; /* Pointer to optab[] entry */
425 {/* * * * * * * * * * START OF mshand() * * * * * * * * * */
427 register int k;
429 objini(j);
431 FETCH(k);
433 if (k & 0x20)
435 badseq(j,k);
436 return;
439 printf("%s\t%s\n",optab[j].text,mtrans(j,k,TR_SEG));
441 objout();
443 }/* * * * * * * * * * * END OF mshand() * * * * * * * * * * */
445 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
447 * This is the handler for pops, other than single-byte *
448 * pops. (The 8088 allows popping into any register, or *
449 * directly into memory, accessed either immediately or *
450 * through a register and an index.) *
452 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
454 void
455 pohand(j)
457 register int j; /* Pointer to optab[] entry */
459 {/* * * * * * * * * * START OF pohand() * * * * * * * * * */
461 char *a;
462 register int k;
464 objini(j);
466 FETCH(k);
468 if (k & 0x38)
470 badseq(j,k);
471 return;
474 printf("%s\t",optab[j].text);
476 a = mtrans((j & 0xfd),k,TR_STD);
478 mtrunc(a);
480 printf("%s\n",a);
482 objout();
484 }/* * * * * * * * * * * END OF pohand() * * * * * * * * * * */
486 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
488 * This is the handler routine for intersegment calls and *
489 * jumps. Its output is never symbolic, because the host *
490 * linker does not allow symbolic intersegment address *
491 * references except by means of symbolic constants, and *
492 * any such constants in the symbol table, even if they *
493 * are of the appropriate value, may be misleading. In *
494 * compiled code, intersegment references should not be *
495 * encountered, and even in assembled code, they should *
496 * occur infrequently. If and when they do occur, however, *
497 * they will be disassembled in absolute form. *
499 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
501 void
502 cihand(j)
504 int j; /* Pointer to optab[] entry */
506 {/* * * * * * * * * * START OF cihand() * * * * * * * * * */
508 register int m, n;
510 objini(j);
512 printf("%s\t",optab[j].text);
514 FETCH(m);
515 FETCH(n);
517 printf("#0x%04.4x,",((n << 8) | m));
519 FETCH(m);
520 FETCH(n);
522 printf("#0x%04.4x\n",((n << 8) | m));
524 objout();
526 }/* * * * * * * * * * * END OF cihand() * * * * * * * * * * */
528 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
530 * This is the handler for "mov" opcodes with immediate *
531 * data. *
533 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
535 void
536 mihand(j)
538 register int j; /* Pointer to optab[] entry */
540 {/* * * * * * * * * * START OF mihand() * * * * * * * * * */
542 register int k;
543 int m, n;
544 char b[64];
546 objini(j);
548 printf("%s",optab[j].text);
550 if (j & 8)
552 FETCH(m);
553 FETCH(n);
554 k = ((n << 8) | m);
555 if (lookext((long)(k),(PC - 1),b))
556 printf("#%s\n",b);
557 else
558 printf("#%d\n",k);
560 else
562 FETCH(m);
563 printf("*%d\n",m);
566 objout();
568 }/* * * * * * * * * * * END OF mihand() * * * * * * * * * * */
570 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
572 * This is the handler for a family of quick-move opcodes. *
574 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
576 void
577 mqhand(j)
579 int j; /* Pointer to optab[] entry */
581 {/* * * * * * * * * * START OF mqhand() * * * * * * * * * */
583 unsigned long pc;
584 register int m, n;
586 objini(j);
588 pc = PC + 1;
590 FETCH(m);
591 FETCH(n);
593 m = (n << 8) | m;
595 printf("%s\t",optab[j].text);
597 if (j & 2)
598 printf("%s,%s\n",
599 lookup((long)(m),N_DATA,LOOK_ABS,pc),
600 REGS[(j & 1) << 3]);
601 else
602 printf("%s,%s\n",
603 REGS[(j & 1) << 3],
604 lookup((long)(m),N_DATA,LOOK_ABS,pc));
606 objout();
608 }/* * * * * * * * * * * END OF mqhand() * * * * * * * * * * */
610 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
612 * This is the handler for a family of quick-test opcodes. *
614 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
616 void
617 tqhand(j)
619 int j; /* Pointer to optab[] entry */
621 {/* * * * * * * * * * START OF tqhand() * * * * * * * * * */
623 register int m, n;
624 int k;
625 char b[64];
627 objini(j);
629 printf("%s\t%s,",optab[j].text,REGS[(j & 1) << 3]);
631 FETCH(m);
633 if (j & 1)
635 FETCH(n);
636 k = ((n << 8) | m);
637 if (lookext((long)(k),(PC - 1),b))
638 printf("#%s\n",b);
639 else
640 printf("#%d\n",k);
642 else
644 if (m & 80)
645 m |= 0xff00;
646 printf("*%d\n",m);
649 objout();
651 }/* * * * * * * * * * * END OF tqhand() * * * * * * * * * * */
653 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
655 * This is the handler for multiple-byte "return" opcodes. *
656 * The 8088 allows returns to take an optional 16-bit ar- *
657 * gument, which reflects the amount to be added to SP *
658 * after the pop of the return address. The idea is to *
659 * facilitate the use of local parameters on the stack. *
660 * After some rumination, it was decided to disassemble *
661 * any such arguments as absolute quantities, rather than *
662 * rummaging through the symbol table for possible corre- *
663 * sponding constants. *
665 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
667 void
668 rehand(j)
670 int j; /* Pointer to optab[] entry */
672 {/* * * * * * * * * * START OF rehand() * * * * * * * * * */
674 register int m, n;
676 objini(j);
678 FETCH(m);
679 FETCH(n);
681 m = (n << 8) | m;
683 printf("%s\t#0x%04.4x\n",optab[j].text,m);
685 objout();
687 }/* * * * * * * * * * * END OF rehand() * * * * * * * * * * */
689 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
691 * This is the handler for "mov" opcodes involving memory *
692 * and immediate data. *
694 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
696 void
697 mmhand(j)
699 register int j; /* Pointer to optab[] entry */
701 {/* * * * * * * * * * START OF mmhand() * * * * * * * * * */
703 char *a;
704 register int k;
705 char b[64];
707 objini(j);
709 FETCH(k);
711 if (k & 0x38)
713 badseq(j,k);
714 return;
717 printf("%s",optab[j].text);
719 if ( ! (j & 1) )
720 putchar('b');
722 a = mtrans((j & 0xfd),(k & 0xc7),TR_STD);
724 mtrunc(a);
726 printf("\t%s,",a);
728 if (j & 1)
730 FETCH(j);
731 FETCH(k);
732 k = (k << 8) | j;
733 if (lookext((long)(k),(PC - 1),b))
734 printf("#%s\n",b);
735 else
736 printf("#%d\n",k);
738 else
740 FETCH(k);
741 printf("*%d\n",k);
744 objout();
746 }/* * * * * * * * * * * END OF mmhand() * * * * * * * * * * */
748 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
750 * This is the handler for the 8088 family of shift and *
751 * rotate instructions. *
753 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
755 void
756 srhand(j)
758 register int j; /* Pointer to optab[] entry */
760 {/* * * * * * * * * * START OF srhand() * * * * * * * * * */
762 char *a;
763 register int k;
765 objini(j);
767 FETCH(k);
769 if ((k & 0x38) == 0x30)
771 badseq(j,k);
772 return;
775 printf("%s",OPFAM[((k & 0x38) >> 3) + 16]);
777 if ( ! (j & 1) )
778 putchar('b');
780 a = mtrans((j & 0xfd),(k & 0xc7),TR_STD);
782 mtrunc(a);
784 printf("\t%s",a);
786 if (j & 2)
787 printf(",cl\n");
788 else
789 printf(",*1\n");
791 objout();
793 }/* * * * * * * * * * * END OF srhand() * * * * * * * * * * */
795 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
797 * This is the handler for the ASCII-adjust opcodes. *
799 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
801 void
802 aahand(j)
804 register int j; /* Pointer to optab[] entry */
806 {/* * * * * * * * * * START OF aahand() * * * * * * * * * */
808 register int k;
810 objini(j);
812 FETCH(k);
814 if (k != 0x0a)
816 badseq(j,k);
817 return;
820 printf("%s\n",optab[j].text);
822 objout();
824 }/* * * * * * * * * * * END OF aahand() * * * * * * * * * * */
826 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
828 * This is the handler for port I/O opcodes which specify *
829 * the port address as an immediate operand. *
831 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
833 void
834 iohand(j)
836 register int j; /* Pointer to optab[] entry */
838 {/* * * * * * * * * * START OF iohand() * * * * * * * * * */
840 register int k;
842 objini(j);
844 FETCH(k);
846 printf("%s\t0x%02.2x\n",optab[j].text,k);
848 objout();
850 }/* * * * * * * * * * * END OF iohand() * * * * * * * * * * */
852 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
854 * This is the handler for opcodes which perform long *
855 * (sixteen-bit) relative jumps and calls. *
857 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
859 void
860 ljhand(j)
862 register int j; /* Pointer to optab[] entry */
864 {/* * * * * * * * * * START OF ljhand() * * * * * * * * * */
866 register int k;
867 int m, n;
869 objini(j);
871 FETCH(m);
872 FETCH(n);
874 k = (n << 8) | m;
876 printf("%s\t%s\t\t| loc %05.5lx\n",optab[j].text,
877 lookup((PC + k + 1L),N_TEXT,LOOK_LNG,(PC - 1L)),
878 (PC + k + 1L));
880 objout();
882 }/* * * * * * * * * * * END OF ljhand() * * * * * * * * * * */
884 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
886 * This is the handler for a pair of oddball opcodes (0xf6 *
887 * and 0xf7) which perform miscellaneous arithmetic opera- *
888 * tions not dealt with elsewhere. *
890 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
892 void
893 mahand(j)
895 register int j; /* Pointer to optab[] entry */
897 {/* * * * * * * * * * START OF mahand() * * * * * * * * * */
899 char *a;
900 register int k;
901 char b[64];
903 objini(j);
905 FETCH(k);
907 a = mtrans((j & 0xfd),(k & 0xc7),TR_STD);
909 mtrunc(a);
911 switch (((k = objbuf[1]) & 0x38) >> 3)
913 case 0 :
914 printf("\ttest");
915 break;
916 case 1 :
917 badseq(j,k);
918 return;
919 case 2 :
920 printf("\tnot");
921 break;
922 case 3 :
923 printf("\tneg");
924 break;
925 case 4 :
926 printf("\tmul");
927 break;
928 case 5 :
929 printf("\timul");
930 break;
931 case 6 :
932 printf("\tdiv");
933 break;
934 case 7 :
935 printf("\tidiv");
936 break;
939 if ( ! (j & 1) )
940 putchar('b');
942 printf("\t%s",a);
944 if (k & 0x38)
945 putchar('\n');
946 else
947 if (j & 1)
949 FETCH(j);
950 FETCH(k);
951 k = (k << 8) | j;
952 if (lookext((long)(k),(PC - 1),b))
953 printf(",#%s\n",b);
954 else
955 printf(",#%d\n",k);
957 else
959 FETCH(k);
960 printf(",*%d\n",k);
963 objout();
965 }/* * * * * * * * * * * END OF mahand() * * * * * * * * * * */
967 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
969 * This is the handler for miscellaneous jump, call, push, *
970 * and increment/decrement opcodes (0xfe and 0xff) which *
971 * are not dealt with elsewhere. *
973 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
975 void
976 mjhand(j)
978 register int j; /* Pointer to optab[] entry */
980 {/* * * * * * * * * * START OF mjhand() * * * * * * * * * */
982 char *a;
983 register int k;
985 objini(j);
987 FETCH(k);
989 a = mtrans((j & 0xfd),(k & 0xc7),TR_STD);
991 mtrunc(a);
993 switch (((k = objbuf[1]) & 0x38) >> 3)
995 case 0 :
996 printf("\tinc");
997 if ( ! (j & 1) )
998 putchar('b');
999 putchar('\t');
1000 break;
1001 case 1 :
1002 printf("\tdec");
1003 if ( ! (j & 1) )
1004 putchar('b');
1005 putchar('\t');
1006 break;
1007 case 2 :
1008 if (j & 1)
1009 printf("\tcall\t@");
1010 else
1011 goto BAD;
1012 break;
1013 case 3 :
1014 if (j & 1)
1015 printf("\tcalli\t@");
1016 else
1017 goto BAD;
1018 break;
1019 case 4 :
1020 if (j & 1)
1021 printf("\tjmp\t@");
1022 else
1023 goto BAD;
1024 break;
1025 case 5 :
1026 if (j & 1)
1027 printf("\tjmpi\t@");
1028 else
1029 goto BAD;
1030 break;
1031 case 6 :
1032 if (j & 1)
1033 printf("\tpush\t");
1034 else
1035 goto BAD;
1036 break;
1037 case 7 :
1038 BAD :
1039 badseq(j,k);
1040 return;
1043 printf("%s\n",a);
1045 objout();
1047 }/* * * * * * * * * * * END OF mjhand() * * * * * * * * * * */