fix syntax error with getOperandNumber
This commit is contained in:
parent
c6ff7e1c4e
commit
f4fd71a330
@ -21,9 +21,10 @@
|
||||
//takes inputted char array and returns the integer of the operand, skipping the first character
|
||||
//e.g. for a passed "R32", it skips the 'R' and returns 32
|
||||
int getOperandNumber(char *operand){
|
||||
char *operandCpy = strcpy(operandCpy, operand);
|
||||
char *operandCpy = NULL;
|
||||
strcpy(operandCpy, operand);
|
||||
operandCpy++;
|
||||
char **endptr;
|
||||
char **endptr = NULL;
|
||||
int number = strtol(operandCpy, endptr, 10);
|
||||
return number;
|
||||
}
|
||||
@ -74,7 +75,6 @@ void generateLoadStoreOperands(a64inst_instruction *instr, char *opcode, char *o
|
||||
}
|
||||
char *endptr;
|
||||
instr->data.SingleTransferData.target = strtol(&(operandList[0][0])+1, &endptr, 10);
|
||||
calcluateAddressFormat(instr, operandList, numOperands);
|
||||
break;
|
||||
case a64inst_LOADLITERAL:
|
||||
break;
|
||||
@ -242,6 +242,7 @@ void parser_instruction(char asmLine[], a64inst_instruction *instr) {
|
||||
break;
|
||||
case a64inst_SINGLETRANSFER:
|
||||
generateLoadStoreOperands(instr, opcode, operandList, numOperands);
|
||||
calcluateAddressFormat(instr, operandList, numOperands);
|
||||
break;
|
||||
case a64inst_LOADLITERAL:
|
||||
generateLoadStoreOperands(instr, opcode, operandList, numOperands);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user