Destructive Register and Interrupt

Some of the MMR changes its state if you read it. Most of MMR is not like this. But some legacy devices which requires compatibility does. The UART is the typical legacy devices. Once you read the UART_IIR or UART_RBR, the state of UART is changed.
You should read these register with interrupt disabled.
BLACKfin core loads memory data speculatively. This speculation splits the loading operation and actual execution ( commit ) of load instruction. Then, interrupt may cancel the load instruction after it loaded data from MMR. Such the behavior makes fatal damage to the destructive register as above. Then you should read such the MMR under interrupt disabled condition like following:

    p0.L = UART_IIR;
    p0.H = UART_IIR;
    cli r0;           // Disable Interrupt
    r1 = w[p0](z);    // Load UART_IIR
    sti r0;           // Interrupt condition is restored.

But you can not forbid the NMI event with above code. So, you realize now NMI should be used really fetal condition which cannot be recovered like power fail.
Also the emulation event will make destructive change on this kind of MMR. You should be careful if you use step or break point on MMR loading.