打印

请问,这是不是一个错误

[复制链接]
1670|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
shilei1014|  楼主 | 2008-4-23 09:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
pc, TI, TE, se, IO
我现在在阅读PSoC Designer Assembly Language User Guide。
在4.16    Jump if No Carry中,说执行指令JNC后,PC的值由未执行JNC指令时的PC值加上expr:if(CF = 0){PC← PC + k},但是由下面的例子来看,应该是PC←(PC+1)+k.请问这是一个错误么?谢谢!


4.16 Jump if No Carry                                        JNC
           Description: If the Carry Flag is not set, jump to the                address indicated by the sum of the
argument and the PC value. The JNC instruction uses a two-byte instruction
format where the lower nibble of the first byte is used for the upper 4
bits of the 12-bit relative address. This causes an effective 4-bit opcode.
Therefore, the following are all valid “opcode” bytes for the JNC     instruction:0xE0, 0xE1, 0xE2,...,0xEF.
Arguments Operation Opcode Cycles Bytes
JNC expr 0xDx 5 2
CF Carry Flag unaffected.
ZF Zero Flag unaffected.
Example: 0000               _main:
         0000 55 3C 02 [08] mov [3Ch], 2
         0003 16 3C 02 [09] sub [3Ch], 2 ;2-1=0 CF=0, ZF=1
         0006 D0 02    [05] jnc SubFun ; jump to SubFun
         0008 30       [04] halt
         0009
         0009               SubFun:
         0009 40       [04] nop
沙发
PSoC_Rock| | 2008-4-23 13:32 | 只看该作者

这不是一个错误

应该是PC←(PC+1)+k。
k是偏移量。因为jnc为两个字节的指令,PC的指针是指在第一个字节上,所以如果条件满足,PC的指针将变为(PC+1)+k。








使用特权

评论回复
板凳
shilei1014|  楼主 | 2008-4-23 13:35 | 只看该作者

RE:2楼

    我今天上午把指令集看完了,只有那一条JNC跳转指令是那个形式的,想想,大概是datasheet错了。
    谢谢您!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

38

帖子

0

粉丝