Author: kjs
Date: Sun Dec 7 07:47:41 2008
New Revision: 33612
Modified:
trunk/compilers/pirc/new/pircompunit.c
trunk/compilers/pirc/new/piremit.c
Log:
[pirc] fix something I shouldn't have committed; + nicer layout for offsets.
Modified: trunk/compilers/pirc/new/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.c (original)
+++ trunk/compilers/pirc/new/pircompunit.c Sun Dec 7 07:47:41 2008
@@ -1878,9 +1878,10 @@
switch (argvalue->type) {
case EXPR_TARGET:
- if (argvalue->expr.t->s.sym == NULL &&
argvalue->expr.t->s.reg == NULL)
- fprintf(stderr, "No sym or reg!\n");
- flag |= argvalue->expr.t->s.sym->type;
+ if (TEST_FLAG(argvalue->expr.t->flags, TARGET_FLAG_IS_REG))
+ flag |= argvalue->expr.t->s.reg->type;
+ else
+ flag |= argvalue->expr.t->s.sym->type;
break;
case EXPR_CONSTANT:
flag |= argvalue->expr.c->type;
Modified: trunk/compilers/pirc/new/piremit.c
==============================================================================
--- trunk/compilers/pirc/new/piremit.c (original)
+++ trunk/compilers/pirc/new/piremit.c Sun Dec 7 07:47:41 2008
@@ -217,7 +217,7 @@
print_expressions(lexer, ins->operands);
}
else {
- fprintf(out, "%u %s ", ins->offset, ins->opname);
+ fprintf(out, "%04u %s ", ins->offset, ins->opname);
print_expressions(lexer, ins->operands);
@@ -276,6 +276,7 @@
/* set iterator to first item */
subroutine *subiter = lexer->subs->next;
+
do {
/*