diff --git a/src/parser.c b/src/parser.c index 2ffc104..b2ed421 100644 --- a/src/parser.c +++ b/src/parser.c @@ -212,8 +212,15 @@ void parse_instruction(char asmLine[], a64inst_instruction *instr) { if(strcmp(opcode, ".int") == 0){ // Directive instr->type = a64inst_DIRECTIVE; - instr->data.DirectiveData.value = getOperandNumber(tokens[1]); - + char *intValue = tokens[1]; + char *endptr; + if(strncmp(intValue, "0x", 2) == 0) { + intValue += 2; + instr->data.DirectiveData.value = strtol(intValue, &endptr, 16); + } else { + instr->data.DirectiveData.value = strtol(tokens[1], &endptr, 10); + } + } else if(opcode[strlen(opcode)-1]== ':') { // Label instr->type = a64inst_LABEL;