summaryrefslogtreecommitdiff
path: root/src/cmd/8c/txt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/8c/txt.c')
-rw-r--r--src/cmd/8c/txt.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/cmd/8c/txt.c b/src/cmd/8c/txt.c
index 1b7617bc5..5c486af38 100644
--- a/src/cmd/8c/txt.c
+++ b/src/cmd/8c/txt.c
@@ -146,9 +146,7 @@ gclean(void)
continue;
if(s->type == types[TENUM])
continue;
- textflag = s->dataflag;
gpseudo(AGLOBL, s, nodconst(s->type->width));
- textflag = 0;
}
nextpc();
p->as = AEND;
@@ -965,7 +963,7 @@ print("botch in doindex\n");
else if(n->left->op == OREGISTER)
idx.ptr = n->left->reg;
else if(n->left->op != OADDR) {
- reg[D_BP]++; // cant be used as a base
+ reg[D_BP]++; // can't be used as a base
regalloc(&nod1, &regnode, Z);
cgen(n->left, &nod1);
idx.ptr = nod1.reg;
@@ -1381,8 +1379,16 @@ gpseudo(int a, Sym *s, Node *n)
p->as = a;
p->from.type = D_EXTERN;
p->from.sym = s;
- p->from.scale = textflag;
- textflag = 0;
+
+ switch(a) {
+ case ATEXT:
+ p->from.scale = textflag;
+ textflag = 0;
+ break;
+ case AGLOBL:
+ p->from.scale = s->dataflag;
+ break;
+ }
if(s->class == CSTATIC)
p->from.type = D_STATIC;
@@ -1392,6 +1398,15 @@ gpseudo(int a, Sym *s, Node *n)
}
void
+gpcdata(int index, int value)
+{
+ Node n1;
+
+ n1 = *nodconst(index);
+ gins(APCDATA, &n1, nodconst(value));
+}
+
+void
gprefetch(Node *n)
{
Node n1;