2

Supposed we have a load instruction followed by another load instruction, then what is the order of execution? Example:

lui $t0, 0x1000    #(1)
lbu $t1, ($t0)     #(2)
addi $t0, $t0, 1   #(3)

I tested it with Spim, the result was in order (1) -> (2) -> (3) and I cant understand since load instrucion should take into account load delay slots.

Musa
  • 96,336
  • 17
  • 118
  • 137
PiD
  • 31
  • 5
  • `$t1` isn't used in the instruction after `lbu $t1, ($t0)`(which seems to be missing an offset) so I don't see a problem – Musa Oct 19 '12 at 05:36
  • Hi, thank you for your reply, however if (3) is executed before (2) then $t(1) should load the content at 0x10000001, however, in my test it loaded the content at 0x10000000. – PiD Oct 19 '12 at 05:39
  • Also, there is a confusion came to my mind, is there any load delay slot after an immediate load instruction like "lui"? – PiD Oct 19 '12 at 05:50
  • Thanks a lot for your answer Musa, after a time of working with the code and combine with your answer now I think that I am completely clear. – PiD Oct 19 '12 at 05:55

0 Answers0