您的位置:首页>财经 >内容

retire和retreat(RETI与RET有什么区别)

2022-09-07 22:51:15来源:
导读每日小编都会为大家带来一些知识类的文章,那么今天小编为大家带来的是RETI与RET有什么区别方面的消息知识,那么如果各位小伙伴感兴趣的话...

每日小编都会为大家带来一些知识类的文章,那么今天小编为大家带来的是RETI与RET有什么区别方面的消息知识,那么如果各位小伙伴感兴趣的话可以,认真的查阅一下下面的内容哦。

atmel公司的芯片手册关于RETI是这么说的

Description: RETI pops the high- and low-order bytes of the PC successively from the stack and restores the interrupt logic to accept additional interrupts at the same priority level as the one just processed. The Stack Pointer is left decremented by two. No other registers are effected; the PSW is not automatically restored to its pre-interrupt status. Program execution continues at the resulting address, which is generally the instruction immediately afte the point at which the interrupt request was detected. If a lower- or same-level interrupt was pending when the RETI instruction is executed, that one instruction is executed before the pending interrupt is processed.

而RET是这么说的

版例权归声芝律士回答网般四站或原作者所有

Description: RET pops the high- and low-order bytes of the PC successively from the stack, decrementing the Stack Pointer by two. Program execution continues at the resulting address, generally the instruction immediately following an ACALL or LCALL. No flags are affected.

不他多次七切务完音厂听。

举例说明:

假设SP为60H

MOV A,#12H

等里量然象北,联约何专。

PUSH ACC ;SP=61H, 61H地址的内容为0x12

MOV A,#13H

PUSH ACC ;SP=62H, 62H地址中的内容为0x13

RET ;SP=60H, PC=0x1312;

完整的程序:可以在KEIL里面软件仿真看看结果

ORG 0000H

LJMP MAIN

ORG 0100H

MAIN:

MOV SP, #60H

MOV A, #12H

PUSH ACC

MOV A, #13H

PUSH ACC

RET

ORG 1312H

SJMP $ //原地跳转

END

本文到此结束,希望对大家有所帮助。

免责声明:本文由用户上传,如有侵权请联系删除!

猜你喜欢

最新文章