#138 Computed GOTO cycle timing wrong

closed-fixed
Roy Rankin
None
5
2013-03-24
2012-03-22
Anonymous
No

I run the following code in gpsim, Using the GUI stopwatch, one trip through the loop is reported as 5 cycles. On the hardware, this takes 6 cycles since modifying PCL causes a stall while the new (computed) instruction is fetched. Essentially, it looks as if gpsim counts instructions which modify PCL diretcly as taking one cycle to execute, when they should take two cycles.

list P=PIC12F508
#include <P12F508.INC>

ORG 0

MAIN_LOOP:
movlw 0
addwf PCL
nop
goto MAIN_LOOP

END

Discussion

  • Roy Rankin
    Roy Rankin
    2013-03-24

    • assigned_to: nobody --> roy_r_rankin
    • status: open --> closed-fixed
     


Anonymous


Cancel   Add attachments