|
This isn't homework its juust a practice question for my computing Lab exam, I don't expect you to 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. Here's what I've attempted, $5 has a stored from bits 0-7, b from 8-15 etc up to d.
.set noreorder # Avoid reordering instructions .text # Start generating instructions .globl start # The label should be globally known .ent start # The label marks an entry point start: srl $8, $5, 16 # removes d and c sll $8, $8, 24 # $t0=b srl $9, $9, 8 # removes d from c, b, and a sll $9, $5, 24 # $t1=c sll $10, $5, 24 # $t2=d addu $11, $8, $9 # temp= b+c addu $4, $11, $10 # a= temp+d iloop: j iloop # infinite loop nop .end start # Marks the end of the program
|