1 #define RCSID4 "$Id: mach4.c,v 3.7 1994/06/23 16:08:49 ceriel Exp $"
4 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * See the copyright notice in the ACK home directory, in the file "Copyright".
27 newrelo($2.typ, RELO1);
32 { if ($2!=2) serror("register error");
44 { regsize($1); emit1(0366|($1&1)); ea_1($1&070);}
46 { regsize($1); emit1(0366|($1&1)); ea_1($1&070);}
49 | CALFOP expr ':' expr
52 newrelo($4.typ, RELO2);
56 newrelo($2.typ, RELO2);
61 { emit1(0377); ea_2($1&0xFF);}
62 | ENTER absexp ',' absexp
63 { fit(fitw($2)); fit(fitb($4));
64 emit1($1); emit2((int)$2); emit1((int)$4);
67 { emit1($1); ea_2($2<<3);}
69 { emit1($1); ea_2($4<<3);}
71 { emit1(0xF); emit1($1);
75 { regsize(1); emit1(0xF); emit1($1&07);
87 emit1(0315); emit1($2);
95 newrelo($2.typ, RELO2);
105 /* Intel 8087 coprocessor instructions */
107 { emit1($1); emit1($1>>8);}
109 { emit1($1); ea_2(($1>>8)&070);}
111 { emit1($1); emit1(($1>>8)|$2); }
113 { emit1($1); emit1($1>>8); }
115 { emit1($1); emit1(($1>>8)|$4); }
116 | FST_ST2 ST ',' st_i
117 { emit1($1); emit1(($1>>8)|$4); }
119 { emit1($1|4); emit1((($1>>8)|$2)); }
120 | FST_ST2 st_i ',' ST
121 { emit1($1|4); emit1((($1>>8)|$2)^010); }
124 st_i : ST '(' absexp ')'
126 serror("illegal index in FP stack");
132 { mrg_2 = 6; exp_2 = $2;
133 RELOMOVE(rel_2, relonami);
136 { exp_2.val = 0; exp_2.typ = S_ABS; indexed();}
138 { exp_2 = $1; indexed();
139 RELOMOVE(rel_2, relonami);
144 | '(' R16 ')' '(' R16 ')'
145 { mrg_2 = dr_m[$2][$5];}
149 { mrg_2 = $1 | 0300;}
151 { mrg_2 = $1 | 0310;}
155 { mrg_2 = 040; exp_2 = $1;
156 RELOMOVE(rel_2, relonami);
160 { mrg_1 = mrg_2; exp_1 = exp_2;
161 RELOMOVE(rel_1, rel_2);
164 ea_ea : ea_1 ',' ea_2