MIPS32 aluipc instruction implemented in java -
i'm implementing mips32 instruction set in java build simulator. have come aluipc instruction , i'm unsure whether i'm doing correct of not.
in docs mips 32 "this instruction performs pc-relative address calculation. 16-bit immediate shifted left 16 bits, signextended, , added address of aluipc instruction. low 16 bits of result cleared, result aligned on 64k boundary. result placed in gpr rs."
and operation example give :
gpr[rs] <- ~0x0ffff & ( pc + sign_extend( immediate << 16 ) )
my code is:
0x0ffff & (v1 + (v2 << 16));
where v1 pc , v2 immediate, correct in thinking simple store in int , thats answer? or clear 16 lower bits , store high 16?
Comments
Post a Comment