美文网首页
6502芯片:指令集(三)(The Instruction Se

6502芯片:指令集(三)(The Instruction Se

作者: 苹果王子刘泽庆 | 来源:发表于2021-05-13 21:17 被阅读0次

转移操作指令(Branchs)

转移操作指令的作用是用来实现满足指定的条件时,改变程序计数器来中断正常的顺序执行流。所有的条件都基于对处理器状态中的单个位的检查。

指令名称 指令功能 影响标志位
BCC 当进位标志清除时转移(Branch if carry flag clear)
BCS 当进位标志位设置时转移(Branch if carry flag set )
BEQ 当零标志设置时转移(Branch if zero flag set)
BMI 当负标志设置时转移(Branch if negative flag set)
BNE 当零标志清除时转移(Branch if zero flag clear)
BPL 当负标志清除时转移(Branch if negative flag clear)
BVC 当溢出标志清除时转移(Branch if overflow flag clear)
BVS 当溢出标志设置时转移(Branch if overflow flag set)

转移指令在执行时使用相对地址来标识目标指令。由于相对地址使用带符号的8位字节存储,所以在转移之前目标指令大小必须保持在126字节以内,或在转移之后目标指令大小必须保持在128字节内。

状态变更指令(Status Flag Changes)

这些指令用于改变特定状态标志位的值。

指令名称 指令功能 影响标志位
CLC 清除进位标志(Clear carry flag) C
CLD 清除十进制模式标志(Clear decimal mode flag ) D
CLI 清除禁止中断标志位(Clear interrupt disable flag) I
CLV 清除溢出标志位(Clear overflow flag) V
SEC 设置进位标志(Set carry flag) C
SED 设置十进制模式标志(Set decimal mode flag) D
SEI 设置禁止中断标志位(Set interrupt disable flag) I

系统功能指令(System Functions)

这些指令是有实际功能的,但是却很少能用到。

指令名称 指令功能 影响标志位
BRK 强制中断(Force an interrupt) B
NOP 空操作(No Operation)
RTI 中断返回(Return from Interrupt) All

相关文章

网友评论

      本文标题:6502芯片:指令集(三)(The Instruction Se

      本文链接:https://www.haomeiwen.com/subject/umyzdltx.html