8086组装中的JMP与CALL [英] JMP vs. CALL in 8086 assembly

查看:93
本文介绍了8086组装中的JMP与CALL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以像使用CALLRET一样使用JMPRET从标签跳回吗?

Can I use JMP and RET to jump back from a label as you would with CALL and RET?

推荐答案

如果您想使用JMP代替CALL,但仍然使用RET或代替RET,则是一个更好的答案:

A better answer if you want to use JMP to replace CALL, but still use RET or as a replacement for RET also:

    PUSH WORD CS:Call_Return
    JMP My_Method
Call_Return:
    ... (cont)

My_Method:
    ...(some code)
    RET

My_Method:
    ...(some code)
    POP DX
    JMP DX

这只是证明可以用许多不同的方式来做同样的事情. 假定16位寻址(实模式)在这种情况下确实有所不同.在32位/64位寻址模式下,您需要相应地更改push,pop和JMP命令.

This just proves it is possible to do the same thing many different ways. This assumes 16-bit addressing (real mode) which does make a difference in this case. In 32-bit/64-bit addressing modes you will need to change the push, pop, and JMP commands accordingly.

这篇关于8086组装中的JMP与CALL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆