1 /* $Id: C_out_skel.c,v 1.8 1994/06/24 10:54:42 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 /* makecalls: expand a datastructure as delivered by "EM_getline"
7 into calls to the procedural interface.
14 #define PRIVATE static
25 extern char em_flag[]; /* One per EM instruction: indicates parameter kind */
26 extern short em_ptyp[]; /* One per parameter kind: indicates parameter type */
33 register struct e_instr *p;
38 C_error = "Illegal EM line";
41 /* normal instruction */
42 if ((em_flag[p->em_opcode-sp_fmnem] & EM_PAR) == PAR_W &&
44 #include "C_mnem_narg"
51 /* defining occurrence of an instruction label */
55 /* defining occurrence of a global data label */
59 /* defining occurrence of a non-numeric data label */
60 C_df_dnam(p->em_dnam);
67 /* start of a MES pseudo */
68 C_mes_begin((int) (p->em_cst));
71 switch(p->em_argtype) {
76 C_dlb(p->em_dlb, p->em_off);
79 C_dnam(p->em_dnam, p->em_off);
88 C_scon(p->em_string, p->em_size);
91 C_icon(p->em_string, p->em_size);
94 C_ucon(p->em_string, p->em_size);
97 C_fcon(p->em_string, p->em_size);
100 C_error = "Illegal argument type";
108 if (C_error) return 0;
114 register struct e_instr *p;
117 switch(p->em_opcode) {
119 C_error = "EXC not allowed";
123 switch(p->em_argtype) {
125 C_hol_cst(EM_holsize,
130 C_hol_icon(EM_holsize,
136 C_hol_ucon(EM_holsize,
142 C_hol_fcon(EM_holsize,
148 C_hol_dnam(EM_holsize,
154 C_hol_dlb(EM_holsize,
160 C_hol_ilb(EM_holsize,
165 C_hol_pnam(EM_holsize,
170 C_error = "Illegal parameter type";
176 switch(p->em_argtype) {
178 C_bss_cst(EM_bsssize,
183 C_bss_icon(EM_bsssize,
189 C_bss_ucon(EM_bsssize,
195 C_bss_fcon(EM_bsssize,
201 C_bss_dnam(EM_bsssize,
207 C_bss_dlb(EM_bsssize,
213 C_bss_ilb(EM_bsssize,
218 C_bss_pnam(EM_bsssize,
223 C_error = "Illegal parameter type";
229 if (p->em_argtype != 0) {
237 if (p->em_argtype == nof_ptyp) {
238 if (p->em_opcode == ps_exa) {
239 C_exa_dlb(p->em_dlb);
241 else C_ina_dlb(p->em_dlb);
244 if (p->em_opcode == ps_exa) {
245 C_exa_dnam(p->em_dnam);
247 else C_ina_dnam(p->em_dnam);
256 if (p->em_nlocals >= 0) {
257 C_pro(p->em_pnam, p->em_nlocals);
259 else C_pro_narg(p->em_pnam);
262 switch(p->em_argtype) {
264 C_con_ilb(p->em_ilb);
267 C_con_dlb(p->em_dlb, p->em_off);
270 C_con_dnam(p->em_dnam, p->em_off);
273 C_con_cst(p->em_cst);
276 C_con_pnam(p->em_pnam);
279 C_con_scon(p->em_string, p->em_size);
282 C_con_icon(p->em_string, p->em_size);
285 C_con_ucon(p->em_string, p->em_size);
288 C_con_fcon(p->em_string, p->em_size);
291 C_error = "Illegal argument type";
296 switch(p->em_argtype) {
298 C_rom_ilb(p->em_ilb);
301 C_rom_dlb(p->em_dlb, p->em_off);
304 C_rom_dnam(p->em_dnam, p->em_off);
307 C_rom_cst(p->em_cst);
310 C_rom_pnam(p->em_pnam);
313 C_rom_scon(p->em_string, p->em_size);
316 C_rom_icon(p->em_string, p->em_size);
319 C_rom_ucon(p->em_string, p->em_size);
322 C_rom_fcon(p->em_string, p->em_size);
325 C_error = "Illegal argument type";
330 C_error = "Illegal pseudo instruction";