Advertisement
sawyermade

AND-COMP

Nov 29th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1.         case AND_EXPR: temp = andCount++;
  2.                        codeGenExpr(t->children->data, classNumber, methodNumber);
  3.                        fprintf(fout, "lod 1 6 1            ;AND-START-load-e1\n");
  4.                        fprintf(fout, "mov 2 1              ;and-mov-1-into-r3\n");
  5.                        fprintf(fout, "blt 1 2 #ANDZERO%d    ;and-check-1\n", temp);
  6.                        incSP();
  7.                        codeGenExpr(t->childrenTail->data, classNumber, methodNumber);
  8.                        fprintf(fout, "lod 1 6 1            ;AND-START-load-e1\n");
  9.                        fprintf(fout, "mov 2 1              ;and-mov-1-into-r3\n");
  10.                        fprintf(fout, "blt 1 2 #ANDZERO%d    ;and-check-1\n", temp);
  11.                        fprintf(fout, "str 6 1 2            ;and-set-1\n");
  12.                        fprintf(fout, "jmp 0 #ANDEND%d       ;and-jmp-end\n", temp);
  13.                        fprintf(fout, "#ANDZERO%d: str 6 1 0 ;and-set-zero\n", temp);
  14.                        fprintf(fout, "#ANDEND%d: mov 0 0    ;AND-END\n", temp);
  15.                        break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement