Skip to content

Commit

Permalink
added halt in yacc
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilcm committed Apr 27, 2012
1 parent 7635994 commit 6cc6a5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spsil.h
Expand Up @@ -13,6 +13,7 @@ struct tree
b-boolean constants
a-AND o-OR x-NOT
b-break t-continue m-addresing expr
h-halt
*/
char *name;
int value;
Expand Down Expand Up @@ -925,6 +926,9 @@ void codegen(struct tree * root)
fprintf(fp,"MOV T%d,%s\n",regcount,reg1);
regcount++;
break;
case 'h':
fprintf(fp,"HALT\n");
break;
default:
printf("Unknown nodetype %c\n",root->nodetype); //Debugging
return;
Expand Down

0 comments on commit 6cc6a5b

Please sign in to comment.