JC Jump if carry set
JHS Jump if higher or same
Syntax JC Label
JHS Label
Operation
If C = 1:pc + 2xoffset−> PC
If C = 0:execute following instruction
Description
The status register carry bit (C) is tested. If It is set, the 10-bit signed offset contained in the instruction LSBs are added to the program counter. If C is reset, the next instruction following the jump is executed. JC (Jump if carry/higher or same) are used for the comparison of unsigned numbers (0 to 65536).
Status Bits
Status bits is not affected.
Example
The P1IN.1 signal is used to define or control of the program flow.
1 BIT #01h, &p1in ; State of signal−> Carry 2 JC ; If Carry=1 Then execute program routine A 3 ; carry=0, execute program here
Example
R5 is compared to 15. If the content is higher or the same, branch to LABEL.
1 CMP #, R52 JHS LABEL ; Jump is taken if r5≥15 3 ; Continue here if R5 <
JC of the instruction of assembly