Use symbol, if available, during 'li' pseudoinstruction expansion
MODIFY
src/assembler/rv32i_assembler.cpp
src/assembler/rv32i_assembler.cpp
@@ -198,8 +198,14 @@ void RV32I_Assembler::enableExtI(const ISAInfo<ISA::RV32I>* isa, InstrVec& instr
int immediate = getImmediate(line.tokens.at(2), canConvert);
if(!canConvert) {
+ // Check if the immediate has been made available in the symbol set at this point...
+ auto it = symbols.find(line.tokens.at(2));
+ if(it != symbols.end()){
+ immediate = it->second;
+ } else {
return PseudoExpandRes{Error(line.sourceLine, QString("Invalid immediate '%1'").arg(line.tokens.at(2)))};
}
+ }
// Generate offset required for discerning between positive and negative immediates
if (isInt<12>(immediate)) {

Use symbol, if available, during 'li' pseudoinstruction expansion