Keil Logo


Information in this knowledgebase article applies to:

  • C51 All Versions


I am debugging my C8051Fxxxx firmware in the µVision simulation. Conditional branch instructions on this device take one less clock cycle to complete when the branch is not taken (e.g. JC, JNC, CJNE, etc). The simulation does not reflect this and adds one more cycle to the cycle counter.


The simulation keeps a list of cycle times for all devices that have a non-standard 8051 instruction timing. This list can only keep one cycle count per instruction. Variable instruction timings for the same instruction cannot be handled by design. The maximum amount of cycles an instruction could take is assumed.


Since the simulation assumes the worst case scenario the accuracy is fine for normal application debugging. If for some reason your application has to create timings based on instruction timings please be aware that you will have different timings on hardware. On the Silabs C8051Fxxx series this affects the following instructions:

JC   rel
JNC  rel
JB   bit, rel
JNB  bit, rel
JBC  bit, rel
JZ   rel
JNZ  rel
CJNE A, direct, rel
CJNE A, #data , rel
CJNE Rn,  #data, rel
CJNE @Ri, #data, rel
DJNZ Rn, rel
DJNZ direct, rel

Your application should not rely on cycle timings. This is not considered to be a "best practice" for timing generation.


This behavior exists in all versions.

Last Reviewed: Monday, August 20, 2012

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.