MIPS assembler Question

liunx

Guest
<!--coloro:#6633FF--><span style="color:#6633FF"><!--/coloro-->This isn't homework its juust a practice question for my computing Lab exam, I don't expect you to <br />give me code I just need to know how to get an inter stored in certain bits of register $a1 ($5) out to manipulate it.<br />Here's what I've attempted, $5 has a stored from bits 0-7, b from 8-15 etc up to d.<br /><!--colorc--></span><!--/colorc--><br /><br />.set noreorder # Avoid reordering instructions<br />.text # Start generating instructions<br />.globl start # The label should be globally known<br />.ent start # The label marks an entry point<br /> start: srl $8, $5, 16# removes d and c<br />sll $8, $8, 24# $t0=b<br />srl $9, $9, 8# removes d from c, b, and a<br />sll $9, $5, 24# $t1=c<br />sll $10, $5, 24# $t2=d<br />addu $11, $8, $9# temp= b+c<br />addu $4, $11, $10# a= temp+d<br />iloop:j iloop# infinite loop<br />nop<br />.end start # Marks the end of the program
</div>
 
Back
Top