I added some code to help with constants but it's not working.

This commit is contained in:
Meyer Simon
2025-04-11 12:51:14 -04:00
parent 58b50ccb63
commit 7296a24c74
3 changed files with 60 additions and 7 deletions

View File

@ -23,20 +23,20 @@ void emit_helper(void){
}
}
void emit_binary_op(char* result, Op op, char* arg1, char* arg2){
void emit_binary_op(TableNode * result, Op op, TableNode * arg1, TableNode * arg2){
emit_helper();
current->opcode = op;
current->result = look_up(cur, result);
current->operand1 = look_up(cur, arg1);
current->operand2 = look_up(cur, arg2);
current->result = result;
current->operand1 = arg1;
current->operand2 = arg2;
return;
}
void emit_unary_op(char* result, Op op, char* arg){
void emit_unary_op(TableNode * result, Op op, TableNode * arg){
emit_helper();
current->opcode = op;
current->result = look_up(cur, result);
current->operand1 = look_up(cur, arg);
current->result = result;
current->operand1 = arg;
return;
}