现在我正在编写从内存中间启动的引导加载程序,但在它完成后我需要转到主应用程序,想尝试 jmp 0x00
,但是我的芯片不支持jmp
,我应该如何启动主应用程序?
最佳答案
我会使用 RJMP
:
Relative jump to an address within PC - 2K +1 and PC + 2K (words). In the assembler, labels are used instead of relative operands.
例如:
entry:
rjmp reset
.org 512
reset:
rjmp foo
.org 3072
foo:
rjmp entry
顺便说一句,还有其他几个跳转指令(RJMP、IJMP、RCALL、ICALL、CALL、RET、RETI 等)参见this relevant discussion .
关于c++ - ATmega8 不支持 JMP 指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22112988/