首页 > 其他 > 详细

Assembly之instruction之JC

时间:2015-07-27 22:28:07      阅读:256      评论:0      收藏:0      [点我收藏+]

JC    Jump if carry set
JHS    Jump if higher or same

Syntax   JC  label

      JHS  label

Operation

    If C = 1: PC + 2 × offset −> 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 is added to the program counter. If C is reset, the next instruction following the jump is executed. JC (jump if carry/higher or same) is used for the comparison of unsigned numbers (0 to 65536).

Status Bits

  Status bits are not affected.

Example

  The P1IN.1 signal is used to define or control the program flow.

1 BIT #01h,&P1IN   ; State of signal −> Carry
2 JC PROGA       ; 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 #15,R5
2 JHS LABEL     ; Jump is taken if R5 ≥ 15
3   ......       ; Continue here if R5 < 15

 

Assembly之instruction之JC

原文:http://www.cnblogs.com/mengdie/p/4681102.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!