Assembly之instruction之JC

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
时间: 2024-08-04 12:16:35

Assembly之instruction之JC的相关文章

Assembly之instruction之Status register

The status register (SR/R2), used as a source or destination register, can be used in the register mode only addressed with word instructions. The remaining combinations of addressing modes are used to support the constant generator.

Bit Twiddling Hacks

http://graphics.stanford.edu/~seander/bithacks.html Bit Twiddling Hacks By Sean Eron Anderson[email protected] Individually, the code snippets here are in the public domain (unless otherwise noted) — feel free to use them however you please. The aggr

linux内核同步之信号量、顺序锁、RCU、完成量、关闭中断【转】

转自:http://blog.csdn.net/goodluckwhh/article/details/9006065 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 一信号量 信号量的概念 信号量的数据结构和相关API 数据结构 初始化 获取和释放信号量 读写信号量的概念 读写信号量的数据结构 二顺序锁 顺序锁的概念 数据结构 写操作 读操作 三Read-Copy Update RCU 写操作 读操作 释放旧的版本 四完成量Completions 完成量的概念 数据结构

synchronization mutex &amp;semaphore completion &amp;example

Linux offers two kinds of semaphores: ? Kernel semaphores, which are used by kernel control paths ? System V IPC semaphores, which are used by User Mode processes struct semaphore { spinlock_t lock; unsigned int count; struct list_headwait_list; }; s

ULK --- Chap 4: Interrupts and Exceptions

An interrupt is usually defined as an event that alters the sequence of instructions executed by a processor. Such events correspond to electrical signals generated by hardware circuits both inside and outside chip. Interrupts are often divided into

【十分钟教会你汇编】MIPS编程入门(妈妈说标题要高大上,才会有人看&gt;_&lt;!)

无意中找到一篇十分好用,而且篇幅也不是很大的入门教程,通篇阅后,再把“栗子”敲一遍,基本可以有一个比较理性的认识,从而方便更好地进一步深入学习. 废话不多说,上干货(英语好的直接跳过本人的渣翻译了哈——!纯本人手打原创,有错请指教,要转载请声明出处,谢~~): MIPS Architecture and Assembly Language Overview MIPS架构及其汇编初步 (开始之前稍微再提下,整体分为4个结构:) 1: 寄存器种类: 2: 算术及寻址指令 3: 程序结构 4: 系统调

Dump内存中的Assembly到磁盘

发现ConfuserEx这个开源的.NET加密程序用的人也非常多,尤其是老外.屡屡遇到这东西,很头疼,主要是是没有现成的脱壳程序,需要手动脱壳,虽说难度不大,但它更新的速度挺快,一直在变化,总是给人一种追着才能赶上的感觉,真是不爽.话说来,不知国内是真没有大牛,还是大牛都藏着掖着,那些脱壳的程序都是老外的作品,身在天朝又访问不了GG,只能自己动手了.其实本文的目的是根据内存中的源程序集Rebuild一个新的程序集,之所以不是Dump是因为还要把被混淆过的名称和字符串信息还原,显然Dump不能满足

Linking code for an enhanced application binary interface (ABI) with decode time instruction optimization

A code sequence made up multiple instructions and specifying an offset from a base address is identified in an object file. The offset from the base address corresponds to an offset location in a memory configured for storing an address of a variable

Assembly CMP/TEST/JXX etc.

0x01 跳转指令 一般来说,x86中有两种跳转指令: 1.算术跳转,像 JZ (jump if zero), JC (jump if carry), JNC (jump if not carry)等 2.比较跳转:像JE (jump if equal), JB (jump if below), JAE (jump if above or equal)等 第一类跳转应用在算术或逻辑指令之后,例如: sub  eax, ebx jnz  .result_is_not_zero  and  ecx,