### A good answer might be:

`jal address`

# The `jalr` Instruction

The `jal` instruction is used when the address of the subroutine is known at assembly time. For example, here is how `main` would usually call the first subroutine: `jal sub1`

But what if you want to call the first subroutine in a jump table? You can't say `jal sub1add` because that tries to jump to the jump table, not to the first address in it. Here is the instruction to use:

    jalr r     # $ra <― PC+4  $ra <― address 8 bytes away from the jal
               # PC  <― $r   load the PC with the subroutine entry point in $r

This works just like the `jal` instruction except the address of the subroutine is now in a regsiter.

### QUESTION 5:

Here is a section of `main`. Fill in the blanks so that control is passed to `sub1`:

              .text
    main:
              . . . .

              lw    $t0,_______             # get first address in Jump Table

              jalr  _____                   # pass control to sub1

              . . . .

              .data
    sub1add:  .word sub1                    # Jump Table
    sub2add:  .word sub2