construct instr IR from label
This commit is contained in:
parent
8931c151f8
commit
bb0f939539
@ -88,10 +88,15 @@ a64inst_instruction *parser(char asmLine[]){
|
||||
|
||||
if(strcmp(opcode, ".int") == 0){
|
||||
//type is directive
|
||||
instr->type = a64inst_DIRECTIVE;
|
||||
|
||||
} else if(strcmp(opcode[strlen(opcode)-1], ":") == 0) {
|
||||
//type is label
|
||||
//add to symbol table
|
||||
instr->type = a64inst_LABEL;
|
||||
char *opcodeCpy = strdup(opcode);
|
||||
char *labelData = strtok(opcodeCpy, ":");
|
||||
instr->data.label = labelData;
|
||||
} else {
|
||||
//type is instruction
|
||||
int operandCount = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user