Compile lab 2 and 3

Source: Internet
Author: User

Note: The exe function command 17. font is required for Link assembly.

I 've been busy and lazy for a long time... Uncomfortable.

Experiment 2 (1) first write the following Assembly command:

The values of each register must be written below, which is directly shown in the figure and not given.

Here we can see that SS is 2200 and SP is 0100. Because their values are modified, the modified memory address is SS: SP, And the stack

The content is also given in two ways. In the first direct analysis, we can get push ax, push BX, that is, push the values in the ax and BX registers to the stack from the graph

C0fc, 6021 respectively. The other method is to directly use the D command for viewing. We can see that the values modified by push [4] and push [6] are 30f0 and 2f31 respectively (note that this is represented by the small-end method ):

(2)

Enter the following Assembly command:

Here we can see that after the T command, we can use the D command to view the SS address of the stack and find that the content is modified. There is a section in it that contains the value of CS: IP,

That is, the memory address of the Assembly command required for the execution of the T command, but the previous section does not know what it is.

Lab 3

After the code is written, the code is compiled and linked to the. exe file:

Then perform one-step debugging. Note that the p command is directly used here in int 21. Because int 21 is a system function, we do not need to check it, nor do we care about it.

The values of each register are all in the figure, so we won't write them out here.

View the PSP value and share a starting address with the code snippet.

 

Compile lab 2 and 3

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.