FA-89710 / Instruction set emulation / Member archive
Delay slot skipped on taken branches · case 05
The instruction after a taken branch never executes.
Case contract
Input [prog, limit]: word-indexed instructions at byte addresses 4*i: addi rt rs imm, beq/bne/beql rs rt off16, j index, nop, halt; 8 registers with r0 hardwired to 0. Branch target = branch address + 4 + (sign-extended off16 << 2). The instruction after a branch or jump (its delay slot) always executes before control transfers, except that a not-taken beql skips (annuls) its slot. j target = ((pc+4) & 0xF0000000) | (index << 2). Addresses outside the program behave as halt. Return [executed pcs, registers].
Why this case matters
Emulating MIPS-style pipelines requires executing the architectural delay slot and computing targets from the slot address.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| forward taken beq | [[0, 4, 16], [0, 3, 0, 0, 0, 0, 0, 0]] | [[0, 4, 8, 16], [0, 3, 1, 0, 0, 0, 0, 0]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗