ret指令

;ret and call
assume cs:code
stack segment
    db 8 dup(0)
stack ends

code segment
    mov ax,4c00h
    int 21h
start:
    mov ax,stack
    mov ss,ax

    mov sp,8;stack top point

    mov bx,00h
    push bx
    ; mov ax,0
    ; push ax
    ; mov bx,0
    ret ;pop ip
    ;retf ;pop ip,pop cs
code ends
end start

事实上ret就是pop ip把stack里的东西取出来到ip,重新定向代码地址

stack不懂可以找我的另一个文章

posted @ 2022-11-26 17:29  Z_Chan  阅读(157)  评论(0编辑  收藏  举报