Compare commits
138 Commits
hs
...
unlabeled-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1535c43648 | ||
|
|
102c316142 | ||
|
|
3703324c51 | ||
|
|
7e3e49082c | ||
|
|
0778ce4a9a | ||
|
|
7351e38ed5 | ||
|
|
bac0efbedb | ||
|
|
302608566a | ||
|
|
c814b9523d | ||
|
|
39891edd12 | ||
|
|
90df1e5b9a | ||
|
|
1e69d3458c | ||
|
|
6988358e29 | ||
|
|
49137da06b | ||
|
|
594a5bb49b | ||
|
|
e5a282c621 | ||
|
|
4ab54c85a8 | ||
|
|
7ac377c750 | ||
|
|
ad104f9164 | ||
|
|
1b8f41d3b2 | ||
|
|
b532117b2b | ||
|
|
bda5c8409c | ||
|
|
f6da80afd8 | ||
|
|
8a15a3f597 | ||
|
|
ae1e81adb1 | ||
|
|
0c0c3b7892 | ||
|
|
b0de601d5b | ||
|
|
7767012a6e | ||
|
|
bd06330739 | ||
|
|
84ed8ee7ef | ||
|
|
f3e35f5432 | ||
|
|
edcb838b98 | ||
|
|
c17a52c09d | ||
|
|
0032ebfeda | ||
|
|
582a0cc2aa | ||
|
|
dd5ceb7b97 | ||
|
|
470826f0c9 | ||
|
|
1cb39eff7e | ||
|
|
90c1dc7c06 | ||
|
|
39c37e9571 | ||
|
|
3ceada5482 | ||
|
|
3cab14d65e | ||
|
|
7efc02574d | ||
|
|
9f872a7ea0 | ||
|
|
ea5498cd99 | ||
|
|
455cd930ec | ||
|
|
335d55ff4a | ||
|
|
4301dfb7bf | ||
|
|
502a7a86af | ||
|
|
30ca0afe49 | ||
|
|
ad383cbdc0 | ||
|
|
165965eadc | ||
|
|
a6d53a6bcd | ||
|
|
df200afd46 | ||
|
|
9c3a416acd | ||
|
|
9e38bfa060 | ||
|
|
2d6eff961f | ||
|
|
0981b8857b | ||
|
|
69bdddd9ba | ||
|
|
4a36e98f5c | ||
|
|
3c2c03165b | ||
|
|
c4b4a08720 | ||
|
|
6d481ce4d6 | ||
|
|
6a9e49f683 | ||
|
|
1833451151 | ||
|
|
9f778655a6 | ||
|
|
f01e1431b0 | ||
|
|
415ae7e922 | ||
|
|
7b798175ad | ||
|
|
5481dd47a9 | ||
|
|
0a00b80726 | ||
|
|
6a4dc794a2 | ||
|
|
7c07f91e1c | ||
|
|
36c1f227ea | ||
|
|
1fe1bc8c09 | ||
|
|
4e7f357a26 | ||
|
|
9f776924d6 | ||
|
|
cb84476be0 | ||
|
|
d07b17ca5c | ||
|
|
58c679c94c | ||
|
|
e2e78ccd0a | ||
|
|
0d5a4693a7 | ||
|
|
95dd252a5b | ||
|
|
87c5817216 | ||
|
|
b6cfa32faa | ||
|
|
b9ebdc1a07 | ||
|
|
73b651052e | ||
|
|
6913efe107 | ||
|
|
3e7b7990f2 | ||
|
|
9c66801439 | ||
|
|
2976b590af | ||
|
|
a837112d99 | ||
|
|
13685d4bc0 | ||
|
|
45887f2b72 | ||
|
|
4d48191bcc | ||
|
|
fedaa3267a | ||
|
|
3d4feae541 | ||
|
|
88b487cd7b | ||
|
|
90a899316e | ||
|
|
08632dc7bd | ||
|
|
ae27a86236 | ||
|
|
fd0066f3a6 | ||
|
|
1092994a09 | ||
|
|
da7230a8eb | ||
|
|
1ca93d7aa1 | ||
|
|
9d8dd3f989 | ||
|
|
c5345aaaba | ||
|
|
fd23647c1c | ||
|
|
4724e96474 | ||
|
|
8df0cf17d6 | ||
|
|
37730ff9ca | ||
|
|
a1e7cc26f4 | ||
|
|
137fa9ebce | ||
|
|
0cacc96ed8 | ||
|
|
4a20e17a9b | ||
|
|
3bfc57ecd0 | ||
|
|
86d96452a3 | ||
|
|
e88028dcb9 | ||
|
|
1e1fc36653 | ||
|
|
cdebe97db8 | ||
|
|
08545984f4 | ||
|
|
b8e156100f | ||
|
|
9109aaaada | ||
|
|
b51fa518be | ||
|
|
c2b1975015 | ||
|
|
ca89e47aa4 | ||
|
|
26ba8cc8fd | ||
|
|
c94c590501 | ||
|
|
38a943d27a | ||
|
|
916b1b016e | ||
|
|
a72cc54578 | ||
|
|
9b6418c324 | ||
|
|
e03e8c7607 | ||
|
|
2cb8aae438 | ||
|
|
533d2bb940 | ||
|
|
828b4d62c9 | ||
|
|
7e31dee840 | ||
|
|
a4a5fc4bfa |
@@ -1,256 +0,0 @@
|
||||
#ifndef NORCSID
|
||||
static char rcsid[] = "$Header$";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
*
|
||||
* This product is part of the Amsterdam Compiler Kit.
|
||||
*
|
||||
* Permission to use, sell, duplicate or disclose this software must be
|
||||
* obtained in writing. Requests for such permissions may be sent to
|
||||
*
|
||||
* Dr. Andrew S. Tanenbaum
|
||||
* Wiskundig Seminarium
|
||||
* Vrije Universiteit
|
||||
* Postbox 7161
|
||||
* 1007 MC Amsterdam
|
||||
* The Netherlands
|
||||
*
|
||||
* Author: Hans van Staveren
|
||||
*/
|
||||
|
||||
/*
|
||||
* machine dependent back end routines for the PDP-11
|
||||
*/
|
||||
|
||||
static char procnam[40] ;
|
||||
|
||||
/* #define REGPATCH /* save all registers in markblock */
|
||||
|
||||
con_part(sz,w) register sz; word w; {
|
||||
|
||||
while (part_size % sz)
|
||||
part_size++;
|
||||
if (part_size == TEM_WSIZE)
|
||||
part_flush();
|
||||
if (sz == 1) {
|
||||
w &= 0xFF;
|
||||
if (part_size)
|
||||
w <<= 8;
|
||||
part_word |= w;
|
||||
} else {
|
||||
assert(sz == 2);
|
||||
part_word = w;
|
||||
}
|
||||
part_size += sz;
|
||||
}
|
||||
|
||||
con_mult(sz) word sz; {
|
||||
long l;
|
||||
|
||||
if (sz != 4)
|
||||
fatal("bad icon/ucon size");
|
||||
#ifdef ACK_ASS
|
||||
fprintf(codefile,".long %s\n",str);
|
||||
#else
|
||||
l = atol(str);
|
||||
fprintf(codefile,"\t%o;%o\n",(int)(l>>16),(int)l);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* The next function is difficult to do when not running on a PDP 11 or VAX
|
||||
* The strategy followed is to assume the code generator is running on a PDP 11
|
||||
* unless the ACK_ASS define is on.
|
||||
* In the last case floating point constants are simply not handled
|
||||
*/
|
||||
|
||||
con_float() {
|
||||
#ifdef ACK_ASS
|
||||
static int been_here;
|
||||
|
||||
if (argval != 4 && argval != 8)
|
||||
fatal("bad fcon size");
|
||||
fprintf(codefile,".long\t");
|
||||
if (argval == 8)
|
||||
fprintf(codefile,"F_DUM,");
|
||||
fprintf(codefile,"F_DUM\n");
|
||||
if ( !been_here++)
|
||||
fprintf(stderr,"Warning : dummy float-constant(s)\n");
|
||||
#else
|
||||
double f;
|
||||
register short *p,i;
|
||||
|
||||
if (argval != 4 && argval != 8)
|
||||
fatal("bad fcon size");
|
||||
f = atof(str);
|
||||
p = (short *) &f;
|
||||
i = *p++;
|
||||
if (argval == 8) {
|
||||
fprintf(codefile,"\t%o;%o;",i,*p++);
|
||||
i = *p++;
|
||||
}
|
||||
fprintf(codefile,"\t%o;%o\n",i,*p++);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef REGVARS
|
||||
|
||||
char Rstring[10];
|
||||
full lbytes;
|
||||
struct regadm {
|
||||
char *ra_str;
|
||||
long ra_off;
|
||||
} regadm[2];
|
||||
int n_regvars;
|
||||
|
||||
regscore(off,size,typ,score,totyp) long off; {
|
||||
|
||||
if (size != 2)
|
||||
return(-1);
|
||||
score -= 1; /* allow for save/restore */
|
||||
if (off>=0)
|
||||
score -= 2;
|
||||
if (typ==reg_pointer)
|
||||
score *= 17;
|
||||
else if (typ==reg_loop)
|
||||
score = 10*score+50; /* Guestimate */
|
||||
else
|
||||
score *= 10;
|
||||
return(score); /* estimated # of words of profit */
|
||||
}
|
||||
|
||||
i_regsave() {
|
||||
|
||||
Rstring[0] = 0;
|
||||
n_regvars=0;
|
||||
}
|
||||
|
||||
f_regsave() {
|
||||
register i;
|
||||
|
||||
if (n_regvars==0 || lbytes==0) {
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"mov r2,-(sp)\nmov r4,-(sp)\n");
|
||||
#endif
|
||||
fprintf(codefile,"mov r5,-(sp)\nmov sp,r5\n");
|
||||
if (lbytes == 2)
|
||||
fprintf(codefile,"tst -(sp)\n");
|
||||
else if (lbytes!=0)
|
||||
fprintf(codefile,"sub $0%o,sp\n",lbytes);
|
||||
for (i=0;i<n_regvars;i++)
|
||||
fprintf(codefile,"mov %s,-(sp)\n",regadm[i].ra_str);
|
||||
} else {
|
||||
if (lbytes>6) {
|
||||
fprintf(codefile,"mov $0%o,r0\n",lbytes);
|
||||
fprintf(codefile,"jsr r5,PR%s\n",Rstring);
|
||||
} else {
|
||||
fprintf(codefile,"jsr r5,PR%d%s\n",lbytes,Rstring);
|
||||
}
|
||||
}
|
||||
for (i=0;i<n_regvars;i++) {
|
||||
if (regadm[i].ra_off>=0)
|
||||
fprintf(codefile,"mov 0%lo(r5),%s\n",regadm[i].ra_off,
|
||||
regadm[i].ra_str);
|
||||
/* generate equates for access to registers */
|
||||
fprintf(codefile,"~%s%s=%ld.\n",regadm[i].ra_str+1, procnam,
|
||||
regadm[i].ra_off) ;
|
||||
}
|
||||
}
|
||||
|
||||
regsave(regstr,off,size) char *regstr; long off; {
|
||||
|
||||
fprintf(codefile,"%c Local %ld into %s\n",COMMENTCHAR,off,regstr);
|
||||
/* commented away
|
||||
#ifndef REGPATCH
|
||||
fprintf(codefile,"mov %s,-(sp)\n",regstr);
|
||||
#endif
|
||||
strcat(Rstring,regstr);
|
||||
if (off>=0)
|
||||
fprintf(codefile,"mov 0%lo(r5),%s\n",off,regstr);
|
||||
end of commented away */
|
||||
|
||||
strcat(Rstring,regstr);
|
||||
regadm[n_regvars].ra_str = regstr;
|
||||
regadm[n_regvars].ra_off = off;
|
||||
n_regvars++;
|
||||
}
|
||||
|
||||
regreturn() {
|
||||
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"jmp eret\n");
|
||||
#else
|
||||
fprintf(codefile,"jmp RT%s\n",Rstring);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
doplb(name) char *name ; {
|
||||
register char *p, *q ;
|
||||
p=procnam, q=name ;
|
||||
while ( *p++ = *q++ ) ;
|
||||
fprintf(codefile,"%s:\n",name) ;
|
||||
}
|
||||
|
||||
prolog(nlocals) full nlocals; {
|
||||
|
||||
#ifndef REGVARS
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"mov r2,-(sp)\nmov r4,-(sp)\n");
|
||||
#endif
|
||||
fprintf(codefile,"mov r5,-(sp)\nmov sp,r5\n");
|
||||
if (nlocals == 0)
|
||||
return;
|
||||
if (nlocals == 2)
|
||||
fprintf(codefile,"tst -(sp)\n");
|
||||
else
|
||||
fprintf(codefile,"sub $0%o,sp\n",nlocals);
|
||||
#else
|
||||
lbytes = nlocals;
|
||||
#endif
|
||||
}
|
||||
|
||||
dlbdlb(as,ls) string as,ls; {
|
||||
|
||||
if (strlen(as)+strlen(ls)+2<sizeof(labstr)) {
|
||||
strcat(ls,":");
|
||||
strcat(ls,as);
|
||||
} else
|
||||
fatal("too many consecutive labels");
|
||||
}
|
||||
|
||||
mes(type) word type; {
|
||||
int argt ;
|
||||
|
||||
switch ( (int)type ) {
|
||||
case ms_ext :
|
||||
for (;;) {
|
||||
switch ( argt=getarg(
|
||||
ptyp(sp_cend)|ptyp(sp_pnam)|sym_ptyp) ) {
|
||||
case sp_cend :
|
||||
return ;
|
||||
default:
|
||||
strarg(argt) ;
|
||||
#ifdef ACK_ASS
|
||||
fprintf(codefile,".define %s\n",argstr) ;
|
||||
#else
|
||||
fprintf(codefile,".globl %s\n",argstr) ;
|
||||
#endif
|
||||
break ;
|
||||
}
|
||||
}
|
||||
default :
|
||||
while ( getarg(any_ptyp) != sp_cend ) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
char *segname[] = {
|
||||
".text", /* SEGTXT */
|
||||
".data", /* SEGCON */
|
||||
".data", /* SEGROM */
|
||||
".bss" /* SEGBSS */
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
/* $Header$ */
|
||||
|
||||
/* The next define switches between codegeneration for an ACK assembler
|
||||
* or for the standard UNIX V7 assembler.
|
||||
* If on code is generated for the ACK assembler.
|
||||
*/
|
||||
/* #define ACK_ASS /* code for ACK assembler */
|
||||
|
||||
#ifdef ACK_ASS
|
||||
#define COMMENTCHAR '!'
|
||||
#define ex_ap(y) fprintf(codefile,".extern %s\n",y)
|
||||
#else
|
||||
#define COMMENTCHAR '/'
|
||||
#define ex_ap(y) fprintf(codefile,".globl %s\n",y)
|
||||
#endif
|
||||
#define in_ap(y) /* nothing */
|
||||
|
||||
#define newplb(x) doplb(x)
|
||||
#define newilb(x) fprintf(codefile,"%s:\n",x)
|
||||
#define newdlb(x) fprintf(codefile,"%s:\n",x)
|
||||
#ifdef ACK_ASS
|
||||
#define newlbss(l,x) fprintf(codefile,"%s:.space 0%o\n",l,x);
|
||||
#else
|
||||
#define newlbss(l,x) fprintf(codefile,"%s:.=.+0%o\n",l,x);
|
||||
#endif
|
||||
|
||||
#define cst_fmt "$0%o"
|
||||
#define off_fmt "0%o"
|
||||
#define ilb_fmt "I%03x%x"
|
||||
#define dlb_fmt "_%d"
|
||||
#define hol_fmt "hol%d"
|
||||
|
||||
#define hol_off "0%o+hol%d"
|
||||
|
||||
#ifdef ACK_ASS
|
||||
#define con_cst(x) fprintf(codefile,".short 0%o\n",x)
|
||||
#define con_ilb(x) fprintf(codefile,".short %s\n",x)
|
||||
#define con_dlb(x) fprintf(codefile,".short %s\n",x)
|
||||
#else
|
||||
#define con_cst(x) fprintf(codefile,"0%o\n",x)
|
||||
#define con_ilb(x) fprintf(codefile,"%s\n",x)
|
||||
#define con_dlb(x) fprintf(codefile,"%s\n",x)
|
||||
#endif
|
||||
|
||||
#define id_first '_'
|
||||
#define BSS_INIT 0
|
||||
2852
mach/pdp/cg/table
2852
mach/pdp/cg/table
File diff suppressed because it is too large
Load Diff
2341
util/cgg/bootgram.y
Normal file
2341
util/cgg/bootgram.y
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user