You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
429 B
17 lines
429 B
from instruction.ri.riInstr import SignExtRegImmInstr
|
|
|
|
#无符号加立即数
|
|
class Addiu(SignExtRegImmInstr):
|
|
def execute(self):
|
|
super().execute()
|
|
|
|
op1 = self.hw.pplReg[2][0].read()
|
|
op2 = self.hw.pplReg[2][1].read()
|
|
rt = self.hw.pplReg[2][2].read()
|
|
|
|
mask = (1 << 32) - 1
|
|
res = (op1 + op2) & mask
|
|
|
|
self.hw.pplReg[3][0].write(res)
|
|
self.hw.pplReg[3][1].write(rt)
|