generate offset operand for load literal with immediate value

This commit is contained in:
EDiasAlberto 2024-06-09 23:07:45 +01:00
parent 44bb327b7d
commit d0be871e8f

View File

@ -153,11 +153,19 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
}
} else {
instr->type = a64inst_LOADLITERAL;
//instr->data.processOpData.offset = {} to be defined by symbol table
if(strcmp(operandList[0][0], "#")==0){
//offset is immediate
char *immOffset = strdup(operandList[0])
immOffset++;
char *endptr;
int offset = strtol(immOffset, endptr, 10);
instr->data.SingleTransferData.processOpData.loadLiteralData.offset = offset;
} else {
//offset is literal, use symbol table and calculate difference
}
}
} else {
int numOperands = sizeof(operandList) / sizeof(operandList[0])
if(classifyDPInst(operandList)){
instr->type = a64inst_DPREGISTER;
} else {