6502 装配 JMP

发布于 2025-01-12 19:03:07 字数 316 浏览 3 评论 0原文

如果我使用这个操作码

JMP
Jump to New Location

(PC+1) -> PCL
(PC+2) -> PCH
N   Z   C   I   D   V
-   -   -   -   -   -
addressing  assembler   opc bytes   cycles
absolute    JMP oper    4C  3   3  

并给它一个十六进制值,比如 0x0604,它会跳转到该位置执行那里的内容,然后继续直到它返回到 JMP 语句,还是会执行 0x0604 处的内容,然后执行联合管理计划

If I use this opcode

JMP
Jump to New Location

(PC+1) -> PCL
(PC+2) -> PCH
N   Z   C   I   D   V
-   -   -   -   -   -
addressing  assembler   opc bytes   cycles
absolute    JMP oper    4C  3   3  

and give it a hex value of say 0x0604 will it jump to that location execute what's there and then continue until it gets back to the JMP statement, or will it execute whats at 0x0604 and then do the next instruction after the JMP

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2025-01-19 19:03:07

JMP $0604 指令会将程序计数器更改为值 $0604,然后开始执行从地址 $0604 开始的指令。它不会返回到JMP之后的指令。为此,您需要将 JMP 更改为 JSR,并确保 $604 处的子例程代码具有 RTS 指令从子程序返回。

A JMP $0604 instruction will change the program counter to the value $0604 and then start executing the instructions starting at address $0604. It will not return back to the instruction after the JMP. To accomplish that you need to change the JMP to a JSR, and make sure the subroutine code at $604 has an RTS instruction to return from the subroutine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文