Application returns to wrong place on RTI

Hi everyone, thanks Craig for help.

I try to use UART0 interrupts. I initialize EVT8 as isr_uart0_rx, EVT10 as isr_uart0_tx. I use Terminal program to send and receive bytes from PC to my target board. I send one byte to target board, isr_uart0_rx works correctly, everything is ok, but when I try to send this byte to PC I have a problem. In my dispatcher I send this byte to uart0_thr register, then interrupt isr_uart0_tx generates in this interrupt I read uart_iir register and after rti command my program return to wrong place (my program return to command send byte in dispatcher and I send this byte once more). I control send and receive bytes with oscilloscope.

Does anybody know what's wrong?.

Thanks for help.

RS-232_Terminal.rar.zip