首页 > 其他 > 详细

汇编-理解call,ret

时间:2019-04-10 21:13:55      阅读:138      评论:0      收藏:0      [点我收藏+]
; 有意思的东西,主函数调用子函数用汇编来理解
assume cs:codeseg
codeseg segment

start:    
main:
call sub1 ; 调用子函数1, push IP1
; do something
mov ax, 4c00H
int 21H

sub1:
call sub2 ;调用子函数2, push IP2
; do something 
ret    ; pop IP1, goto "call sub1".next_IP

sub2:
; do something 
ret ; pop IP2, goto "call sub2".next_IP


codeseg ends 
end start

有点像递归。

汇编-理解call,ret

原文:https://www.cnblogs.com/ashen/p/10685920.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!