I am coding a program that uses interrupt handling to play an ascii-based game in MIPS. I am told to "Long call" my main function from my handler. My handler takes place under .ktext 0x80000180 and looks like this:
.ktext  0x80000180
    move    $k1, $at
    beq $13, 0, keyboard
    li  $v0, 10 # Do nothing and exit
    syscall
    keyboard: # else check interupt level
    la  $t9, 0xffff0000
    beq $t9, 1, continue
    li  $v0, 10     # Do nothing and exit
    syscall
    continue:
    jal frogger     # call frogger function
    mtc0    $0, $13     # set cause register to 0
    mfc0    $k0, $12        # Fix status register
    andi    $k0, 0xfffd # clear EXL bit
    ori $k0, 0x1        # Enable interrupts
    mtc0    $k0, $12        # Store value back into status register
    move    $at, $k1
    eret
The problem is with the line jal frogger, it says 
Error in F:\Users\Matt\WSU\Cpts 260\HW9\HW9.asm line 32: Jump target word address beyond 26-bit range.
Is it something wrong with the rest of the code or is there a special way to call a function from the .ktext?
Thanks!
Replace jal frogger by something like:
  la    $t9, frogger
  jalr  $t9
JALR uses an absolute address in MIPS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With