Strange behavior with -bare option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
spim (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: spim
Ubuntu: Ubuntu 8.10
Spim: 7.4-0ubuntu1
When tested with the -bare option, the following code could will produce a result of 0xCAFE for $t0 and 0x03 for $t1. Yet, with a simple analysis of the code, it is clear that it's impossible to have both at the same time. My claim is sustained by the fact that after the beq instruction is triggered, the delay slot is already being executed, therefore j is also triggered. But the ori $t0, $zero, 0xCAFE statement should not be triggered (in j's delay slot) if the jump was made to endbeq. Both cannot happen. Best regards.
.text
.globl main
main: ori $t0, $zero, 0xFACE
ori $t1, $zero, 0x0000
beq $zero, $zero, endbeq
j endj
ori $t0, $zero, 0xCAFE
endbeq: ori $t1, $t1, 0x01
endj: ori $t1, $t1, 0x02
The author has been told about this bug.