Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_Rtype(instruction):
- for i in R_Instuctions:
- if (i==instruction.split(' ')[0]):
- if (i=='sll' or i=='jr'):
- return 'extremes'
- elif (i == instruction.split(' ')[1]):
- return 'Label_detected'
- else:
- return 1
- if(is_Rtype(instruction)=='Label_detected'):
- instParts=instruction.replace(',','').split()
- op='000000'
- rs=Registers[instParts[3]]
- rt=Registers[instParts[4]]
- rd=Registers[instParts[2]]
- shamt='00000'
- funct=R_Funct[instParts[1]]
- return op + rs + rt + rd + shamt + funct
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement