Compare commits
137 Commits
hs
...
unlabeled-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3172abf70d | ||
|
|
b35b5b0c11 | ||
|
|
e8d88ed790 | ||
|
|
2d40a4fa61 | ||
|
|
0f77c7fb9f | ||
|
|
83c3f45a29 | ||
|
|
f84e129361 | ||
|
|
bf86a0f8ef | ||
|
|
e7cbb5780b | ||
|
|
4a4b1ae156 | ||
|
|
63e97ee535 | ||
|
|
b8817780f3 | ||
|
|
530c4d4c63 | ||
|
|
6a1b482c86 | ||
|
|
d530ba1126 | ||
|
|
bcaecff14d | ||
|
|
d568a6aca5 | ||
|
|
77fda75841 | ||
|
|
92587276da | ||
|
|
b2dfaa494e | ||
|
|
b231200eb7 | ||
|
|
4c1ac6ad54 | ||
|
|
d345f87d53 | ||
|
|
3ef854719d | ||
|
|
17cd5516a1 | ||
|
|
a117b57ec9 | ||
|
|
925f0be202 | ||
|
|
9ffcf24477 | ||
|
|
bef1b25962 | ||
|
|
05de05abe7 | ||
|
|
54e3b3db4f | ||
|
|
21c2208de6 | ||
|
|
41cd4c15fd | ||
|
|
714b50f54b | ||
|
|
2ac28f401c | ||
|
|
ba5ae63e87 | ||
|
|
2e1928a4eb | ||
|
|
9a02327a2d | ||
|
|
8c0394eea8 | ||
|
|
085069e600 | ||
|
|
e30901a8c4 | ||
|
|
5d2434ce92 | ||
|
|
398a848925 | ||
|
|
dee952edfa | ||
|
|
1ada89da2a | ||
|
|
02d10bc877 | ||
|
|
1046fc1eea | ||
|
|
b5e86c2482 | ||
|
|
2ab7549af6 | ||
|
|
85435303c8 | ||
|
|
51eccf208f | ||
|
|
b27463bccd | ||
|
|
1d613c24af | ||
|
|
cc22bb4175 | ||
|
|
6a084edba7 | ||
|
|
e9b3f54f7c | ||
|
|
ee4b1850bb | ||
|
|
49a0e9c414 | ||
|
|
56ba46b2bc | ||
|
|
cf20acf289 | ||
|
|
64ff1da3e4 | ||
|
|
8e4156532d | ||
|
|
6e32042c52 | ||
|
|
e551fa234e | ||
|
|
15aec67505 | ||
|
|
03409fb772 | ||
|
|
7fab127af3 | ||
|
|
b4b66ce74f | ||
|
|
fff0d30a9a | ||
|
|
2c0619a13a | ||
|
|
2601187207 | ||
|
|
8d7aa4baad | ||
|
|
6eaf938a14 | ||
|
|
6d42bab835 | ||
|
|
2cd5f2033e | ||
|
|
068dee8a06 | ||
|
|
85b1c8b043 | ||
|
|
a955307239 | ||
|
|
dea117397b | ||
|
|
ac8dee35d0 | ||
|
|
46a5c99978 | ||
|
|
77d2cc5222 | ||
|
|
c4dee9c081 | ||
|
|
4a2029781a | ||
|
|
6cde876c44 | ||
|
|
9adb899d09 | ||
|
|
8c2dd5a6b5 | ||
|
|
73af9ae6cf | ||
|
|
783f95590f | ||
|
|
d5399de251 | ||
|
|
b94907a1fa | ||
|
|
40fcf103bd | ||
|
|
7f230788d0 | ||
|
|
f0445587cf | ||
|
|
a089216ae7 | ||
|
|
150d744512 | ||
|
|
e25887d5ca | ||
|
|
c0e66dc8d3 | ||
|
|
61ab763c07 | ||
|
|
86f29918c8 | ||
|
|
af335c7be5 | ||
|
|
2d11c4b2fe | ||
|
|
6fd15f62dc | ||
|
|
ca787ba372 | ||
|
|
aa65dc9fbd | ||
|
|
ff47f2ee43 | ||
|
|
5be59d3ade | ||
|
|
aa74e86069 | ||
|
|
a915561735 | ||
|
|
9f1edee15f | ||
|
|
a17a987cb8 | ||
|
|
db9268bb08 | ||
|
|
f064ac567e | ||
|
|
17504bb39a | ||
|
|
ad77d9eb14 | ||
|
|
558e2166ba | ||
|
|
c71656ab19 | ||
|
|
23cf9b8443 | ||
|
|
44b78ad38d | ||
|
|
386c0d6e1a | ||
|
|
046ee8050f | ||
|
|
1154d87f41 | ||
|
|
0c16a79a37 | ||
|
|
f177d69279 | ||
|
|
a4368ea2d1 | ||
|
|
675d30712d | ||
|
|
209801cac1 | ||
|
|
9c57272ef9 | ||
|
|
01f22b3870 | ||
|
|
6ade85f76e | ||
|
|
0349b620cd | ||
|
|
6001a4462e | ||
|
|
0d853f8c4b | ||
|
|
e5277be072 | ||
|
|
cc246efa46 | ||
|
|
2fe95a276d | ||
|
|
628d3da626 |
@@ -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