I am using an ISR that does nothing but store/restore the XARn registers, set/clear a GPIO bit upon entering and exiting, and in between execute the senseless code appended below. The GPIO bit enables measuring the execution time of each instruction, indicated as a comment in each line of the code.
My expectation is that each of these is a one-cycle instruction, but that is obviously wrong. The M3 is doing nothing but an infinite while(1) ; loop. The DMACH1 and DMACH2 channels are setup, but they are not started, so there would seem to be no bus contention conflicts. Yet the instructions take multiple cycles to execute, and identical instructions execute in different numbers of cycles.
Can someone tell me what is going on and point me to the right document?
MOVW DP, #variable1_pointer // 1 cycle
MOVL XAR0, @variable1_pointer // 1 cycle
MOV AL, *XAR0 // 4 cycles
MOV *XAR0, AL // 1 cycle
MOVL XAR0, @variable2_pointer // 2 cycle
MOV AL, *XAR0 // 3 cycles
MOV *XAR0, AL // 1 cycle
MOVL XAR0, @variable3_pointer // 1 cycle
MOV AL, *XAR0 // 4 cycles
MOV *XAR0, AL // 1 cycle
MOVL XAR0, @variable4_pointer // 2 cycle
MOV AL, *XAR0 // 3 cycles
MOV *XAR0, AL // 1 cycle