2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 static char rcsid[] = "$Id: mach.c,v 2.8 1994/06/24 13:10:14 ceriel Exp $" ;
14 while (part_size % sz) part_size++;
16 if (part_size == TEM_WSIZE)
18 if (sz == 1 || sz == 2) {
19 w &= (sz == 1 ? 0xFF : 0xFFFF);
33 fatal("bad icon/ucon size");
34 fprintf(codefile,".data4\t%s\n",str);
45 regscore(off,size,typ,score,totyp) long off; {
47 /*This function is copied from pdp/ncg
50 * This function is full of magic constants.
51 * They are a result of experimentation.
56 score -= 1; /* allow for save/restore */
61 else if (typ==reg_loop)
62 score = 10*score+50; /* Guestimate */
65 return(score); /* 10 * estimated # of words of profit */
77 fprintf(codefile, "enter [");
78 for (i=0; i<n_regvars; i++) {
79 fprintf(codefile,"%c%s", c, regadm[i].ra_str);
82 fprintf(codefile, "], %ld\n", lbytes);
83 for (i=0;i<n_regvars;i++)
84 if (regadm[i].ra_off>=0)
85 fprintf(codefile, "movd %ld(fp), %s",
86 regadm[i].ra_off, regadm[i].ra_str);
89 regsave(regstr,off,size) char *regstr; long off; {
91 fprintf(codefile,"\t! Local %ld into %s\n",off,regstr);
92 regadm[n_regvars].ra_str = regstr;
93 regadm[n_regvars].ra_off = off;
101 fprintf(codefile, "exit [");
102 for (i=1; i<n_regvars; i++) {
103 fprintf(codefile,"%c%s", c, regadm[i].ra_str);
106 fprintf(codefile, "]\n");
111 mes(type) word type ; {
114 switch ( (int)type ) {
117 switch ( argt=getarg(
118 ptyp(sp_cend)|ptyp(sp_pnam)|sym_ptyp) ) {
123 fprintf(codefile,".define %s\n",argstr) ;
128 while ( getarg(any_ptyp) != sp_cend ) ;
133 prolog(nlocals) full nlocals; {
136 fprintf(codefile, "enter[], %ld\n",nlocals);
151 static int warning_given;
154 if (! warning_given) {
155 fprintf(stderr, "warning: dummy floating point constant\n");
158 for (i = argval; i > 0; i -= 4) {
159 fputs(".data4 0 ! dummy float\n", codefile);