After compiling a .C file with the SRC directive to produce an assembler output file I have difficulty understanding releative jumps in the .src file. e.g. the line JC $ + 5H LJMP ?C0007 INC R7 Would appear to mean that, when there is a carrythe PC is incremented, first by 2 to get past the jump instruction, and then by a further 5 bytes. However, when there is a carry, the code should just bypass the LJMP instruction and execute the INC R7 instruction (I have examined this code in detail). i.e. a function equivalent is JC label LJMP ?C0007 label: INC R7 The LJMP instruction is only 3 bytes big therefore the offset would jump past the INC R7 instruction (assuming I interpreted the $ +5H offset correctly). The executable works correctly so could anybody tell me where I am going wrong ??????????????? Thank you
The part you have wrong is that the $+5 means that the PC is incremented by 5 from the beginning of the JC instruction. This means that the 2 bytes of the JC + the 3 bytes of the LJMP would be skipped, giving the correct implementation.