Update parseDirective to use getImmediate even without hashtag
This commit is contained in:
parent
41fde09d75
commit
15c8482dd3
@ -130,10 +130,7 @@ static void parse_instruction(char asmLine[], a64inst_instruction *instr) {
|
||||
}
|
||||
|
||||
static void parseDirective(a64inst_instruction *instr, char *opcode, char *tokens[], int tokensCount) {
|
||||
char intValue[strlen(tokens[1]) + 1];
|
||||
*intValue = '#';
|
||||
strcpy(intValue + 1, tokens[1]);
|
||||
instr->data.DirectiveData.value = getImmediate(intValue);
|
||||
instr->data.DirectiveData.value = getImmediate(tokens[1]);
|
||||
}
|
||||
|
||||
static void parseSingleTransfer(a64inst_instruction *instr, char *opcode, char *tokens[], int tokensCount) {
|
||||
|
||||
@ -96,9 +96,7 @@ int getImmediate(char *str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (str[0] != '#')
|
||||
return 0;
|
||||
|
||||
if (str[0] == '#')
|
||||
str++; // skip #
|
||||
|
||||
if (strncmp(str, "0x", 2) == 0 || strncmp(str, "0X", 3) == 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user