Call & JMP command

Source: Internet
Author: User

For JMP commands:

 

(1) JMP short label
Equivalent to (IP) = (IP) + 8-bit displacement jump range is [-128,127]
(2) JMP near PTR labels
Equivalent to (IP) = (IP) + 16-bit displacement jump range is [-32768,32767]
(3) JMP far PTR labels
Equivalent to (CS) = the segment address of the label, (IP) = the offset address of the label


The first two are intra-segment transfer, which is based on displacement. The first is short transfer, the second is near transfer, and the third is inter-segment transfer, directly modify CS and IP addresses for transfer.

There are also JMP commands in the memory for the transfer address, JMP word PTR memory unit address (intra-segment transfer), and jmp dword ptr memory unit address (Inter-segment transfer ).

 

 

For the call & RET command:


(1) call number
It is equivalent to push IP, and then (IP) = (IP) + 16-bit displacement
(2) Call far PTR label
Equivalent to push CS, push IP, (CS) = segment address of the label segment, (IP) = offset address of the label in the segment
(3) Call 16-bit register
Equivalent to push IP and then JMP 16-bit Reg
(4) Call word PTR memory unit address
Equivalent to push ip jmp word PTR memory unit address
For example, call word ptr ds: [0]
(5) Call dword ptr memory unit address
Equivalent to pushing CS push ip jmp dword ptr memory unit address

Call is often used with ret. RET is equivalent to pop IP. If it is inter-segment transfer, retf is used to return the function, which is equivalent to pop IP pop CS.

Call & JMP command

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.