diff --git a/src/parser.c b/src/parser.c index 40e264f..9a1ac25 100644 --- a/src/parser.c +++ b/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 {