Merge branch 'assembler-e' into 'assembler'

create helper function to generate number from operand

See merge request lab2324_summer/armv8_43!12
This commit is contained in:
Niedringhaus, George 2024-06-12 15:26:40 +00:00
commit 5d03e78802

View File

@ -18,6 +18,14 @@
// - ASK ABOUT OFFSET CALCULATION
// - CREATE FUNC TO TIDY UP OPERANDS IN DP
int getOperandNumber(char *operand){
char *operandCpy = strcpy(operandCpy, operand);
operandCpy++;
char **endptr;
int number = strtol(operandCpy, endptr, 10);
return number;
}
int isOperandRegister(char *operand){
return((strcmp(&(operand[0]), "x")==0) || (strcmp(&(operand[0]), "w")==0));
}
@ -161,6 +169,7 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
//offset is literal, use symbol table and calculate difference
}
}
generateLoadStoreOperands(instr, opcode, operandList, numOperands);
} else {
if(classifyDPInst(operandList)){