Compilation Note RET

Source: Internet
Author: User

 DUP (0) stack endscode segment                mov ax,4c00h                int  21h                start:            mov ax,stack                mov ss,ax                mov sp,                                mov ax,0                push AX                mov bx,0                retcode endsend start

Above instruction, let IP point to 0000, the program exits normally.

When you execute push AX, the data in AX is put into buyers, sp=sp-2.

The following 2 steps are performed when the RET instruction is executed:

1: (IP) = ((SS) * + (SP))

2: (sp) = (sp) + 2

The use of assembly directives to denote RET operations is equivalent to:

POP IP

Remove the data from the buyers into the IP.

Compilation Note RET

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.