Pristine Ack-5.5
[Ack-5.5.git] / mach / i86 / ce / EM_table
1 #define PUSH_POP_OPT    TRUE
2
3 /******************************************************************************/
4 /*                                                                            */
5 /*              Group 1 : load instructions                                   */
6 /*                                                                            */
7 /******************************************************************************/
8
9 C_loc           ==>     "mov ax, $1";
10                         "push ax".
11
12 C_ldc           ==>     C_loc( $1>>16);
13                         C_loc( $1).
14
15 C_lol           ==>     "push $1(bp)".
16
17 C_loe..         ==>     "push ($1+$2)".
18
19 C_lil           ==>     "mov bx, $1(bp)";
20                         "push (bx)".
21
22 C_lof           ==>     "pop bx";
23                         "push $1(bx)".
24
25 C_lal           ==>     "lea ax, $1(bp)";
26                         "push ax".
27
28 C_lae..         ==>     "mov ax, $1+$2";
29                         "push ax".
30
31 C_lxl  
32   $1 == 0       ==>     "push bp".
33
34   $1 == 1       ==>     "push 4(bp)".
35
36   default       ==>     "mov cx, $1-1";
37                         "mov bx, 4(bp)";
38                         "1: mov bx, 4(bx)";
39                         "loop 1b";
40                         "push bx".
41
42 C_lxa   
43   $1 == 0       ==>     "lea ax, 4(bp)";
44                         "push ax".
45
46   $1 == 1       ==>     "mov ax, 4(bp)";
47                         "add ax, 4";
48                         "push ax".
49
50   default       ==>     "mov cx, $1-1";
51                         "mov bx, 4(bp)";
52                         "1: mov bx, 4(bx)";
53                         "loop 1b";
54                         "add bx, 4";
55                         "push bx".
56
57 C_loi
58   $1 == 1       ==>     "pop bx";
59                         "xor ax, ax";
60                         "movb al, (bx)";
61                         "push ax".
62
63   $1 == 2       ==>     "pop bx";
64                         "push (bx)".
65          
66   $1 == 4       ==>     "pop bx";
67                         "push 2(bx)";
68                         "push (bx)".
69           
70   default       ==>     "pop bx";
71                         "mov cx, $1";
72                         "call .loi".
73
74 C_los
75   $1 == 2       ==>     "pop cx";
76                         "pop bx";
77                         "call .los".
78
79   default       ==>     arg_error( "C_los", $1).
80
81 C_los_narg      ==>     "pop ax";
82                         "cmp ax, 2";
83                         "jne .unknown";
84                         "pop cx";
85                         "pop bx";
86                         "call .loi".
87
88 C_ldl           ==>     "push $1+2(bp)";
89                         "push $1(bp)".
90
91 C_lde..         ==>     "push ($1+$2+2)";
92                         "push ($1+$2)".
93
94 C_ldf           ==>     "pop bx";
95                         "push $1+2(bx)";
96                         "push $1(bx)".
97
98 C_lpi           ==>     "mov ax, $1";
99                         "push ax".
100
101 /******************************************************************************/
102 /*                                                                            */
103 /*              Group 2 : store instructions                                  */
104 /*                                                                            */
105 /******************************************************************************/
106
107 C_stl           ==>     "pop $1(bp)".
108
109 C_ste..         ==>     "pop ($1+$2)".
110
111 C_sil           ==>     "mov bx, $1(bp)";
112                         "pop (bx)".
113
114 C_stf           ==>     "pop bx";
115                         "pop $1(bx)".
116
117 C_sti
118   $1 == 1       ==>     "pop bx";
119                         "pop ax";
120                         "movb (bx), al".
121
122   $1 == 2       ==>     "pop bx";
123                         "pop (bx)".
124
125   $1 == 4       ==>     "pop bx";
126                         "pop (bx)";
127                         "pop 2(bx)".
128
129   default       ==>     "pop bx";
130                         "mov cx, $1";
131                         "call .sti".
132
133 C_sts
134   $1 == 2       ==>     "pop cx";
135                         "pop bx";
136                         "call .sts".
137
138   default       ==>     arg_error( "C_sts", $1).
139
140 C_sts_narg      ==>     "pop ax";
141                         "cmp ax, 2";
142                         "jne .unknown";
143                         "pop cx";
144                         "pop bx";
145                         "call .sti".
146
147 C_sdl           ==>     "pop $1(bp)";
148                         "pop $1+2(bp)".
149
150 C_sde..         ==>     "pop ($1+$2)";
151                         "pop ($1+$2+2)".
152
153 C_sdf           ==>     "pop bx";
154                         "pop $1(bx)";
155                         "pop $1+2(bx)".
156
157 /******************************************************************************/
158 /*                                                                            */
159 /*              Group 3 : integer arithmetic                                  */
160 /*                                                                            */
161 /******************************************************************************/
162
163 C_adi
164   $1 == 2       ==>     "pop ax";
165                         "pop bx";
166                         "add ax, bx";
167                         "push ax".
168
169   $1 == 4       ==>     "pop ax";
170                         "pop bx";
171                         "pop cx";
172                         "pop dx";
173                         "add ax, cx";
174                         "adc bx, dx";
175                         "push bx";
176                         "push ax".
177
178   default       ==>     "pop ax";
179                         "mov cx, $1";
180                         "call .adi";
181                         "push ax".
182
183 C_adi_narg      ==>     "pop cx";
184                         "pop ax";
185                         "call .adi";
186                         "push ax".
187
188 C_sbi   
189   $1 == 2       ==>     "pop bx";
190                         "pop ax";
191                         "sub ax, bx";
192                         "push ax".
193
194   $1 == 4       ==>     "pop ax";
195                         "pop bx";
196                         "pop cx";
197                         "pop dx";
198                         "sub cx, ax";
199                         "sbb dx, bx";
200                         "push dx";
201                         "push cx".
202
203   default       ==>     "pop ax";
204                         "mov cx, $1";
205                         "call .sbi";
206                         "push ax".
207
208 C_sbi_narg      ==>     "pop cx";
209                         "pop ax";
210                         "call .sbi";
211                         "push ax".
212
213 C_mli
214   $1 == 2       ==>     "pop ax";
215                         "pop bx";
216                         "mul bx";
217                         "push ax".
218
219   $1 == 4       ==>     "pop ax";
220                         "pop dx";
221                         "call .mli4";
222                         "push dx";
223                         "push ax".
224
225   default       ==>     arg_error( "C_mli", $1).
226
227 C_mli_narg      ==>     "pop ax";
228                         "call .mli".
229
230 C_dvi
231   $1 == 2       ==>     "pop bx";
232                         "pop ax";
233                         "cwd";
234                         "idiv bx";
235                         "push ax".
236
237   $1 == 4       ==>     "call .dvi4";
238                         "push dx";
239                         "push ax".
240
241   default       ==>     arg_error( "C_dvi", $1).
242
243 C_dvi_narg      ==>     "pop ax";
244                         "call .dvi".
245
246 C_rmi
247   $1 == 2       ==>     "pop bx";
248                         "pop ax";
249                         "cwd";
250                         "idiv bx";
251                         "push dx".
252
253   $1 == 4       ==>     "call .rmi4";
254                         "push dx";
255                         "push ax".
256
257   default       ==>     arg_error( "C_rmi", $1).
258
259 C_rmi_narg      ==>     "pop ax";
260                         "call .rmi".
261
262 C_ngi
263   $1 == 2       ==>     "pop ax";
264                         "neg ax";
265                         "push ax".
266
267   $1 == 4       ==>     "pop bx";
268                         "pop ax";
269                         "neg ax";
270                         "neg bx";
271                         "sbb ax, 0";
272                         "push ax";
273                         "push bx".
274
275   default       ==>     "mov ax, $1";
276                         "call .ngi".
277
278 C_ngi_narg      ==>     "pop ax";
279                         "call .ngi".
280
281 C_sli
282   $1 == 2       ==>     "pop cx";
283                         "pop ax";
284                         "sal ax, cl";
285                         "push ax".
286
287   default       ==>     "mov ax, $1";
288                         "call .sli".
289
290 C_sli_narg      ==>     "pop ax";
291                         "call .sli".
292
293 C_sri
294   $1 == 2       ==>     "pop cx";
295                         "pop ax";
296                         "sar ax, cl";
297                         "push ax".
298
299   default       ==>     "mov ax, $1";
300                         "call .sri".
301
302 C_sri_narg      ==>     "pop ax";
303                         "call .sri".
304
305 /******************************************************************************/
306 /*                                                                            */
307 /*              Group 4 : Unsigned arithmetic                                 */
308 /*                                                                            */
309 /******************************************************************************/
310
311 C_adu           ==>     C_adi( $1).
312
313 C_adu_narg      ==>     C_adi_narg().
314
315 C_sbu           ==>     C_sbi( $1).
316
317 C_sbu_narg      ==>     C_sbi_narg().
318
319 C_mlu           ==>     C_mli( $1).
320
321 C_mlu_narg      ==>     C_mli_narg().
322
323 C_dvu
324   $1 == 2       ==>     "pop bx";
325                         "pop ax";
326                         "xor dx, dx";
327                         "div bx";
328                         "push ax".
329
330   $1 == 4       ==>     "call .dvu4";
331                         "push dx";
332                         "push ax".
333
334   default       ==>     "mov ax, $1";
335                         "call .dvu".
336
337 C_dvu_narg      ==>     "pop ax";
338                         "call .dvu".
339
340 C_rmu
341   $1 == 2       ==>     "pop bx";
342                         "pop ax";
343                         "xor dx, dx";
344                         "div bx";
345                         "push dx".
346
347   $1 == 4       ==>     "call .dvu4";
348                         "push dx";
349                         "push ax".
350
351   default       ==>     "mov ax, $1";
352                         "call .rmu".
353
354 C_rmu_narg      ==>     "pop ax";
355                         "call .rmu".
356
357 C_slu           ==>     C_sli( $1).
358
359 C_slu_narg      ==>     C_sli_narg().
360
361 C_sru
362   $1 == 2       ==>     "pop cx";
363                         "pop ax";
364                         "shr ax, cl";
365                         "push ax".
366
367   $1 == 4       ==>     "pop cx";
368                         "pop bx";
369                         "pop ax";
370                         "1 : shr ax, 1";
371                         "rcr bx, 1";
372                         "loop 1b";
373                         "push ax";
374                         "push bx".
375
376   default       ==>     arg_error( "C_sru", $1).
377
378 /******************************************************************************/
379 /*                                                                            */
380 /*              Group 5 : Floating point arithmetic                           */
381 /*                                                                            */
382 /******************************************************************************/
383
384 C_adf
385   $1 == 4       ==>     "call .adf4";
386                         "pop bx";
387                         "pop bx".
388   $1 == 8       ==>     "call .adf8";
389                         "add sp,8".
390   default       ==>     arg_error("C_adf", $1).
391
392 C_sbf
393   $1 == 4       ==>     "call .sbf4";
394                         "pop bx";
395                         "pop bx".
396   $1 == 8       ==>     "call .sbf8";
397                         "add sp,8".
398   default       ==>     arg_error("C_sbf", $1).
399
400 C_mlf
401   $1 == 4       ==>     "call .mlf4";
402                         "pop bx";
403                         "pop bx".
404   $1 == 8       ==>     "call .mlf8";
405                         "add sp,8".
406   default       ==>     arg_error("C_mlf", $1).
407
408 C_dvf
409   $1 == 4       ==>     "call .dvf4";
410                         "pop bx";
411                         "pop bx".
412   $1 == 8       ==>     "call .dvf8";
413                         "add sp,8".
414   default       ==>     arg_error("C_dvf", $1).
415
416 C_ngf
417   $1 == 4       ==>     "call .ngf4".
418   $1 == 8       ==>     "call .ngf8".
419   default       ==>     arg_error("C_ngf", $1).
420
421 C_fif
422   $1 == 4       ==>     C_lor((arith)1);
423                         "call .fif4";
424                         "pop bx".
425   $1 == 8       ==>     C_lor((arith)1);
426                         "call .fif8";
427                         "pop bx".
428   default       ==>     arg_error("C_fif", $1).
429
430 C_fef
431   $1 == 4       ==>     "mov ax,sp";
432                         "sub ax,2";
433                         "push ax";
434                         "call .fef4".
435   $1 == 8       ==>     "mov ax,sp";
436                         "sub ax,2";
437                         "push ax";
438                         "call .fef8".
439   default       ==>     arg_error("C_fef", $1).
440
441 /******************************************************************************/
442 /*                                                                            */
443 /*              Group 6 : Pointer arithmetic                                  */
444 /*                                                                            */
445 /******************************************************************************/
446
447 C_adp
448
449 #ifndef PEEPHOLE_OPT
450   $1 == 0       ==>     .
451 #endif
452
453   $1 == 1       ==>     "pop ax";
454                         "inc ax";
455                         "push ax".
456
457   $1 == -1      ==>     "pop ax";
458                         "dec ax";
459                         "push ax".
460
461   default       ==>     "pop ax";
462                         "add ax, $1";
463                         "push ax".
464
465 C_ads
466   $1 == 2       ==>     "pop ax";
467                         "pop bx";
468                         "add ax, bx";
469                         "push ax".
470
471   default       ==>     arg_error( "C_ads", $1).
472
473 C_ads_narg      ==>     "pop ax";
474                         "cmp ax, 2";
475                         "jne .unknown";
476                         "pop ax";
477                         "pop bx";
478                         "add ax, bx";
479                         "push ax".
480
481 C_sbs
482   $1 == 2       ==>     "pop bx";
483                         "pop ax";
484                         "sub ax, bx";
485                         "push ax".
486
487   default       ==>     arg_error( "C_sbs", $1).
488
489 C_sbs_narg      ==>     "pop ax";
490                         "cmp ax, 2";
491                         "jne .unknown";
492                         "pop bx";
493                         "pop ax";
494                         "sub ax, bx";
495                         "push ax".
496
497 /******************************************************************************/
498 /*                                                                            */
499 /*              Group 7 : Increment/decrement/zero                            */
500 /*                                                                            */
501 /******************************************************************************/
502
503 C_inc           ==>     "pop ax";
504                         "inc ax";
505                         "push ax".
506
507 C_inl           ==>     "inc $1(bp)".
508
509 C_ine..         ==>     "inc ($1+$2)".
510
511 C_dec           ==>     "pop ax";
512                         "dec ax";
513                         "push ax".
514
515 C_del           ==>     "dec $1(bp)".
516
517 C_dee..         ==>     "dec ($1+$2)".
518
519 C_zrl           ==>     "mov $1(bp), 0".
520
521 C_zre..         ==>     "mov ($1+$2), 0".
522
523 C_zer
524   $1 == 2       ==>     "xor ax, ax";
525                         "push ax".
526
527   $1 == 4       ==>     "xor ax, ax";
528                         "push ax";
529                         "push ax".
530
531   $1 == 6       ==>     "xor ax, ax";
532                         "push ax";
533                         "push ax";
534                         "push ax".
535
536   $1 == 8       ==>     "xor ax, ax";
537                         "push ax";
538                         "push ax";
539                         "push ax";
540                         "push ax".
541
542   $1 % 2 == 0   ==>     "mov cx, $1/2";
543                         "xor ax, ax";
544                         "1: push ax";
545                         "loop 1b".
546
547   default       ==>     arg_error( "C_zer", $1).
548
549 C_zrf           ==>     C_zer($1).
550
551 C_zer_narg      ==>     "pop cx";
552                         "sar cx, 1";
553                         "xor ax, ax";
554                         "1: push ax";
555                         "loop 1b".
556
557 /******************************************************************************/
558 /*                                                                            */
559 /*              Group 8 : Convert                                             */
560 /*                                                                            */
561 /******************************************************************************/
562
563 C_cii           ==>     "pop cx";
564                         "pop dx";
565                         "pop ax";
566                         "call .cii";
567                         "push ax".
568
569 C_cui           ==>     C_cuu().
570
571 C_ciu           ==>     C_cuu().
572
573 C_cuu           ==>     "pop cx";
574                         "pop dx";
575                         "pop ax";
576                         "call .cuu";
577                         "push ax".
578
579 C_cif           ==>     "call .cif".
580
581 C_cuf           ==>     "call .cuf".
582
583 C_cfi           ==>     "call .cfi";
584                         "pop bx";
585                         "pop cx";
586                         "cmp bx,4";
587                         "je 1f";
588                         "add sp,cx";
589                         "push ax";
590                         "jmp 2f";
591                         "1:add cx,4";
592                         "add sp,cx";
593                         "2:".
594
595 C_cfu           ==>     "call .cfu";
596                         "pop bx";
597                         "pop cx";
598                         "cmp bx,4";
599                         "je 1f";
600                         "add sp,cx";
601                         "push ax";
602                         "jmp 2f";
603                         "1:add cx,4";
604                         "add sp,cx";
605                         "2:".
606
607 C_cff           ==>     "pop ax";
608                         "pop bx";
609                         "cmp ax,bx";
610                         "je 1f";
611                         "cmp ax,4";
612                         "je 2f";
613                         "pop cx";
614                         "pop bx";
615                         "xor ax,ax";
616                         "push ax";
617                         "push ax";
618                         "push bx";
619                         "push cx";
620                         "call .cff8";
621                         "jmp 1f";
622                         "2: call .cff4";
623                         "pop bx";
624                         "pop bx";
625                         "1:".
626
627 /******************************************************************************/
628 /*                                                                            */
629 /*              Group 9 : Logical                                             */
630 /*                                                                            */
631 /******************************************************************************/
632
633 C_and
634   $1 == 2       ==>     "pop ax";
635                         "pop bx";
636                         "and ax, bx";
637                         "push ax".
638
639   $1 == 4       ==>     "pop ax";
640                         "pop bx";
641                         "pop cx";
642                         "pop dx";
643                         "and ax, cx";
644                         "and bx, dx";
645                         "push bx";
646                         "push ax".
647
648   default       ==>     "mov cx, $1";
649                         "call .and".
650
651 C_and_narg      ==>     "pop cx";
652                         "call .and".
653
654 C_ior
655   $1 == 2       ==>     "pop ax";
656                         "pop bx";
657                         "or ax, bx";
658                         "push ax".
659
660   $1 == 4       ==>     "pop ax";
661                         "pop bx";
662                         "pop cx";
663                         "pop dx";
664                         "or ax, cx";
665                         "or bx, dx";
666                         "push bx";
667                         "push ax".
668
669   default       ==>     "mov cx, $1";
670                         "call .ior".
671
672 C_ior_narg      ==>     "pop cx";
673                         "call .ior".
674
675 C_xor
676   $1 == 2       ==>     "pop ax";
677                         "pop bx";
678                         "xor ax, bx";
679                         "push ax".
680
681   $1 == 4       ==>     "pop ax";
682                         "pop bx";
683                         "pop cx";
684                         "pop dx";
685                         "xor ax, cx";
686                         "xor bx, dx";
687                         "push bx";
688                         "push ax".
689
690   default       ==>     "mov cx, $1";
691                         "call .xor".
692
693 C_xor_narg      ==>     "pop cx";
694                         "call .xor".
695
696 C_com
697   $1 == 2       ==>     "pop ax";
698                         "not ax";
699                         "push ax".
700
701   $1 == 4       ==>     "pop ax";
702                         "pop bx";
703                         "not ax";
704                         "not bx";
705                         "push bx";
706                         "push ax".
707
708   default       ==>     "mov cx, $1";
709                         "call .com".
710
711 C_com_narg      ==>     "pop cx";
712                         "call .com".
713
714 C_rol
715   $1 == 2       ==>     "pop cx";
716                         "pop ax";
717                         "rol ax, cl";
718                         "push ax".
719                     
720   default       ==>     "mov cx, $1";
721                         "call .rol".
722
723 C_rol_narg      ==>     "pop cx";
724                         "call .rol".
725
726 C_ror
727   $1 == 2       ==>     "pop cx";
728                         "pop ax";
729                         "ror ax, cl";
730                         "push ax".
731                     
732   default       ==>     "mov cx, $1";
733                         "call .ror".
734
735 C_ror_narg      ==>     "pop cx";
736                         "call .ror".
737
738 /******************************************************************************/
739 /*                                                                            */
740 /*              Group 10 : Sets                                               */
741 /*                                                                            */
742 /******************************************************************************/
743
744 C_inn
745   $1 == 2       ==>     "pop cx";
746                         "pop ax";
747                         "shr ax, cl";
748                         "and ax, 1";
749                         "push ax".
750
751   default       ==>     "pop ax";
752                         "mov cx, $1";
753                         "call .inn";
754                         "push ax".
755   
756 C_inn_narg      ==>     "pop cx";
757                         "pop ax";
758                         "call .inn";
759                         "push ax".
760
761 C_set
762   $1 == 2       ==>     "pop cx";
763                         "mov ax, 1";
764                         "shl ax, cl";
765                         "push ax".
766
767   default       ==>     "pop ax";
768                         "mov cx, $1";
769                         "call .set".
770   
771 C_set_narg      ==>     "pop cx";
772                         "pop ax";
773                         "call .set".
774
775 /******************************************************************************/
776 /*                                                                            */
777 /*              Group 11 : Array                                              */
778 /*                                                                            */
779 /******************************************************************************/
780
781 C_lar
782   $1 == 2       ==>     "pop bx";
783                         "pop ax";
784                         "call .lar2".
785
786   default       ==>     arg_error( "C_lar", $1).
787
788 C_lar_narg      ==>     "call .ilar".
789
790 C_sar
791   $1 == 2       ==>     "pop bx";
792                         "pop ax";
793                         "call .sar2".
794
795   default       ==>     arg_error( "C_sar", $1).
796
797 C_sar_narg      ==>     "call .isar".
798
799 C_aar
800   $1 == 2       ==>     "pop bx";
801                         "pop ax";
802                         "pop cx";
803                         "sub ax, (bx)";
804                         "mul 4(bx)";
805                         "add ax, cx";
806                         "push ax".
807
808   default       ==>     arg_error( "C_aar", $1).
809
810 C_aar_narg      ==>     "call .iaar";
811                         "push bx".
812
813 /******************************************************************************/
814 /*                                                                            */
815 /*              Group 12 : Compare                                            */
816 /*                                                                            */
817 /******************************************************************************/
818
819 C_cmi
820   $1 == 2       ==>     /* bug : C_sbi( (arith) 2). */
821                         "pop bx";
822                         "pop cx";
823                         "xor ax, ax";
824                         "cmp cx, bx";
825                         "je 2f";
826                         "jl 1f";
827                         "inc ax";
828                         "jmp 2f";
829                         "1: dec ax";
830                         "2: push ax".
831           
832   $1 == 4       ==>     "call .cmi4";
833                         "push ax".
834           
835   default       ==>     arg_error( "C_cmi", $1).
836
837 C_cmu
838   $1 == 2       ==>     C_cmp().
839           
840   $1 == 4       ==>     "call .cmu4";
841                         "push ax".
842
843   default       ==>     arg_error( "C_cmu", $1).
844
845 C_cms
846   $1 == 2       ==>     C_sbi( (arith) 2).
847           
848   $1 == 4       ==>     "pop ax";
849                         "pop bx";
850                         "pop cx";
851                         "pop dx";
852                         "sub cx, ax";
853                         "sbb dx, bx";
854                         "jne 1f";
855                         "or dx, cx";
856                         "1: push dx".
857
858   default       ==>     "mov cx, $1";
859                         "call .cms";
860                         "push cx".
861
862 C_cms_narg      ==>     "pop cx";
863                         "call .cms";
864                         "push cx".
865
866 C_cmp           ==>     "pop bx";
867                         "pop cx";
868                         "xor ax, ax";
869                         "cmp cx, bx";
870                         "je 2f";
871                         "jb 1f";
872                         "inc ax";
873                         "jmp 2f";
874                         "1: dec ax";
875                         "2: push ax".
876
877 C_cmf
878   $1 == 4       ==>     "call .cmf4";
879                         "add sp,8";
880                         "push ax".
881   $1 == 8       ==>     "call .cmf8";
882                         "add sp,16";
883                         "push ax".
884   default       ==>     arg_error("C_cmf", $1).
885
886 C_tlt           ==>     "pop ax";
887                         "xor bx, bx";
888                         "test ax, ax";
889                         "jge 1f";
890                         "inc bx";
891                         "1: push bx".
892
893 C_tle           ==>     "pop ax";
894                         "xor bx, bx";
895                         "test ax, ax";
896                         "jg 1f";
897                         "inc bx";
898                         "1: push bx".
899
900 C_teq           ==>     "pop ax";
901                         "xor bx, bx";
902                         "test ax, ax";
903                         "jne 1f";
904                         "inc bx";
905                         "1: push bx".
906
907 C_tne           ==>     "pop ax";
908                         "xor bx, bx";
909                         "test ax, ax";
910                         "je 1f";
911                         "inc bx";
912                         "1: push bx".
913
914 C_tge           ==>     "pop ax";
915                         "xor bx, bx";
916                         "test ax, ax";
917                         "jl 1f";
918                         "inc bx";
919                         "1: push bx".
920
921 C_tgt           ==>     "pop ax";
922                         "xor bx, bx";
923                         "test ax, ax";
924                         "jle 1f";
925                         "inc bx";
926                         "1: push bx".
927
928 /******************************************************************************/
929 /*                                                                            */
930 /*              Group 13 : Branch                                             */
931 /*                                                                            */
932 /******************************************************************************/
933
934 C_bra           ==>     "jmp $1".
935
936 C_blt           ==>     "pop ax";
937                         "pop bx";
938                         "cmp bx, ax";
939                         "jl $1".
940
941 C_ble           ==>     "pop ax";
942                         "pop bx";
943                         "cmp bx, ax";
944                         "jle $1".
945
946 C_beq           ==>     "pop ax";
947                         "pop bx";
948                         "cmp bx, ax";
949                         "je $1".
950
951 C_bne           ==>     "pop ax";
952                         "pop bx";
953                         "cmp bx, ax";
954                         "jne $1".
955
956 C_bge           ==>     "pop ax";
957                         "pop bx";
958                         "cmp bx, ax";
959                         "jge $1".
960
961 C_bgt           ==>     "pop ax";
962                         "pop bx";
963                         "cmp bx, ax";
964                         "jg $1".
965
966 C_zlt           ==>     "pop ax";
967                         "test ax, ax";
968                         "jl $1".
969
970 C_zle           ==>     "pop ax";
971                         "test ax, ax";
972                         "jle $1".
973
974 C_zeq           ==>     "pop ax";
975                         "test ax, ax";
976                         "je $1".
977
978 C_zne           ==>     "pop ax";
979                         "test ax, ax";
980                         "jne $1".
981
982 C_zge           ==>     "pop ax";
983                         "test ax, ax";
984                         "jge $1".
985
986 C_zgt           ==>     "pop ax";
987                         "test ax, ax";
988                         "jg $1".
989
990 /******************************************************************************/
991 /*                                                                            */
992 /*              Group 14 : Procedure call instructions                        */
993 /*                                                                            */
994 /******************************************************************************/
995
996 C_cai           ==>     "pop bx";
997                         "call bx".
998
999 C_cal           ==>     "call $1".
1000
1001 C_lfr
1002   $1 == 2       ==>     "push ax".
1003
1004   $1 == 4       ==>     "push dx";
1005                         "push ax".
1006
1007   $1 == 6       ==>     "call .lfr6".
1008
1009   $1 == 8       ==>     "call .lfr8".
1010
1011   default       ==>     arg_error( "C_lfr", $1).
1012
1013 C_ret
1014   $1 == 0       ==>     "mov sp, bp";
1015                         "pop bp";
1016                         "ret".
1017
1018   $1 == 2       ==>     "pop ax";
1019                         "mov sp, bp";
1020                         "pop bp";
1021                         "ret".
1022
1023   $1 == 4       ==>     "pop ax";
1024                         "pop dx";
1025                         "mov sp, bp";
1026                         "pop bp";
1027                         "ret".
1028
1029   $1 == 6       ==>     "call .ret6";
1030                         "mov sp, bp";
1031                         "pop bp";
1032                         "ret".
1033
1034   $1 == 8       ==>     "call .ret8";
1035                         "mov sp, bp";
1036                         "pop bp";
1037                         "ret".
1038
1039   default       ==>     arg_error( "C_ret", $1).
1040
1041 /******************************************************************************/
1042 /*                                                                            */
1043 /*              Group 15 : Miscellaneous instructions                         */
1044 /*                                                                            */
1045 /******************************************************************************/
1046
1047 C_asp
1048   $1 == 2       ==>     "pop bx".
1049
1050   $1 == 4       ==>     "pop bx";
1051                         "pop bx".
1052
1053   $1 == -2      ==>     "push ax".
1054
1055   default       ==>     "add sp, $1".
1056
1057 C_ass
1058   $1 == 2       ==>     "pop ax";
1059                         "add sp, ax".
1060
1061   default       ==>     arg_error( "C_ass", $1).
1062
1063 C_ass_narg      ==>     "pop ax";
1064                         "cmp ax, 2";
1065                         "jne .unknown";
1066                         "pop ax";
1067                         "add sp, ax".
1068
1069 C_blm
1070   $1 % 2 == 0   ==>     "mov cx, $1/2";
1071                         "call .blm".
1072
1073   default       ==>     arg_error( "C_blm", $1).
1074
1075 C_bls
1076   $1 == 2       ==>     "pop cx";
1077                         "sar cx,1";
1078                         "call .blm".
1079
1080   default       ==>     arg_error( "C_bls", $1).
1081
1082 C_bls_narg      ==>     "pop ax";
1083                         "cmp ax, 2";
1084                         "jne .unknown";
1085                         "pop cx";
1086                         "sar cx, 1";
1087                         "call .blm".
1088
1089 C_csa
1090   $1 == 2       ==>     "pop bx";
1091                         "pop ax";
1092                         "jmp .csa2".
1093
1094   default       ==>     arg_error( "C_csa", $1).
1095
1096 C_csa_narg      ==>     "pop ax";
1097                         "cmp ax, 2";
1098                         "jne .unknown";
1099                         "pop bx";
1100                         "pop ax";
1101                         "jmp .csa2".
1102
1103 C_csb
1104   $1 == 2       ==>     "pop bx";
1105                         "pop ax";
1106                         "jmp .csb2".
1107
1108   default       ==>     arg_error( "C_csb", $1).
1109
1110 C_csb_narg      ==>     "pop ax";
1111                         "cmp ax, 2";
1112                         "jne .unknown";
1113                         "pop bx";
1114                         "pop ax";
1115                         "jmp .csb2".
1116
1117 C_dch           ==>     "mov bp, (bp)".
1118
1119 C_dup
1120   $1 == 2       ==>     "pop ax";
1121                         "push ax";
1122                         "push ax".
1123
1124   $1 == 4       ==>     "pop ax";
1125                         "pop bx";
1126                         "push bx";
1127                         "push ax";
1128                         "push bx";
1129                         "push ax".
1130
1131   default       ==>     "mov cx, $1";
1132                         "call .dup".
1133
1134 C_dus
1135   $1 == 2       ==>     "pop cx";
1136                         "call .dup".
1137
1138   default       ==>     arg_error( "C_dus", $1).
1139
1140 C_dus_narg      ==>     "pop ax";
1141                         "cmp ax, 2";
1142                         "jne .unknown";
1143                         "pop cx";
1144                         "call .dup".
1145
1146 C_exg           ==>     "mov cx, $1";
1147                         "call .exg".
1148
1149 C_exg_narg      ==>     "pop cx";
1150                         "call .exg".
1151
1152 C_fil..         ==>     "mov (hol0+4), $1+$2".
1153
1154 C_gto..         ==>     "mov bx, $1+$2";
1155                         "call .gto".
1156
1157 C_lim           ==>     "push (.ignmask)".
1158
1159 C_lin           ==>     "mov (hol0), $1".
1160
1161 C_lni           ==>     "inc (hol0)".
1162
1163 C_lor
1164   $1 == 0       ==>     "push bp".
1165
1166   $1 == 1       ==>     "mov ax, sp";
1167                         "push ax".
1168
1169   $1 == 2       ==>     "push (.reghp)".
1170
1171   default       ==>     arg_error( "C_lor", $1).
1172
1173 C_lpb           ==>     "pop ax";
1174                         "add ax,4";
1175                         "push ax".
1176
1177 C_mon           ==>     "pop ax";
1178                         "call .mon".
1179
1180 C_nop           ==>     .
1181
1182 C_rck
1183   $1 == 2       ==>     "pop bx";
1184                         "pop ax";
1185                         "call .rck";
1186                         "push ax".
1187
1188   default       ==>     arg_error( "C_rck", $1).
1189
1190 C_rck_narg      ==>     "pop ax";
1191                         "cmp ax, 2";
1192                         "jne .unknown";
1193                         "pop bx";
1194                         "pop ax";
1195                         "call .rck";
1196                         "push ax".
1197
1198
1199 C_rtt           ==>     C_ret( (arith) 0).
1200
1201 C_sig           ==>     "pop ax";
1202                         "xchg (.trppc), ax";
1203                         "push ax".
1204
1205 C_sim           ==>     "pop (.ignmask)".
1206
1207 C_str
1208   $1 == 0       ==>     "pop bp".
1209
1210   $1 == 1       ==>     "pop sp".
1211
1212   $1 == 2       ==>     "pop (.reghp)".
1213
1214   default       ==>     arg_error( "C_str", $1).
1215
1216 C_trp           ==>     "pop ax";
1217                         "call .trp".
1218
1219 /******************************************************************************/
1220 /*                                                                            */
1221 /*              Storage-routines                                              */
1222 /*                                                                            */
1223 /******************************************************************************/
1224
1225
1226 ..icon
1227   $2 == 1       ==>     gen1( (ONE_BYTE) atoi( $1)).
1228   $2 == 2       ==>     gen2( (TWO_BYTES) atoi( $1)).
1229   $2 == 4       ==>     gen4( (FOUR_BYTES) atol( $1)).
1230   default       ==>     arg_error( "..icon", $1).
1231
1232 ..ucon
1233   $2 == 1       ==>     gen1( (ONE_BYTE) atoi( $1)).
1234   $2 == 2       ==>     gen2( (TWO_BYTES) atoi( $1)).
1235   $2 == 4       ==>     gen4( (FOUR_BYTES) atol( $1)).
1236   default       ==>     arg_error( "..ucon", $1).
1237
1238 ..fcon          ==>     con_float($1, $2).
1239
1240 /******************************************************************************/
1241 /*                                                                            */
1242 /*              Extra-routines                                                */
1243 /*                                                                            */
1244 /******************************************************************************/
1245
1246 #ifdef PUSH_POP_OPT
1247
1248 C_df_ilb        ==>     clean_push_buf();
1249                         symbol_definition( $1);
1250                         set_local_visible( $1).
1251 #endif
1252
1253 C_jump          ==>             "jmp $1".
1254
1255 C_prolog                ==>     "push bp";
1256                                 "mov bp, sp".
1257
1258 C_locals
1259   $1 == 0               ==>     .
1260
1261   $1 == 2               ==>     "push ax".
1262
1263   $1 == 4               ==>     "push ax";
1264                                 "push ax".
1265
1266   default               ==>     "sub sp, $1".