fix use of cpp syntax
This commit is contained in:
parent
9c6a459b23
commit
225ade7770
11
src/parser.c
11
src/parser.c
@ -84,8 +84,13 @@ void generateBranchOperands(a64inst_instruction *instr, char* opcode, char *oper
|
|||||||
}
|
}
|
||||||
|
|
||||||
void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[]){
|
void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[]){
|
||||||
if((int isUnconditional = strcmp(opcode, "b")) == 0 ||
|
int isUnconditional = strcmp(opcode, "b");
|
||||||
(int isRegister = strcmp(opcode, "br")) == 0 ||
|
int isRegister = strcmp(opcode, "br");
|
||||||
|
int isLoad = strcmp(opcode, "ldr");
|
||||||
|
int isStore = strcmp(opcode, "str");
|
||||||
|
|
||||||
|
if(isUnconditional == 0 ||
|
||||||
|
isRegister == 0 ||
|
||||||
strncmp(opcode, "b.", 2) == 0){
|
strncmp(opcode, "b.", 2) == 0){
|
||||||
instr->type = a64inst_BRANCH;
|
instr->type = a64inst_BRANCH;
|
||||||
if(isUnconditional){
|
if(isUnconditional){
|
||||||
@ -97,7 +102,7 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
|
|||||||
//instr->data.branchData.processOpData.cond = {remove first two chars of opcode}
|
//instr->data.branchData.processOpData.cond = {remove first two chars of opcode}
|
||||||
}
|
}
|
||||||
generateBranchOperands(instr, opcode, operandList);
|
generateBranchOperands(instr, opcode, operandList);
|
||||||
} else if((int isLoad = strcmp(opcode, "ldr")) == 0 || (int isStore = strcmp(opcode, "str")) == 0){
|
} else if(isLoad == 0 || isStore == 0){
|
||||||
//loading/storing instruction; classify operands
|
//loading/storing instruction; classify operands
|
||||||
char *address = operandList[1];
|
char *address = operandList[1];
|
||||||
if( *address == '['){
|
if( *address == '['){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user