generate offset operand for load literal with immediate value
This commit is contained in:
parent
44bb327b7d
commit
d0be871e8f
12
src/parser.c
12
src/parser.c
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user