Experiment 2 machine instruction and assembly instruction Programming

Source: Internet
Author: User

Task 1

Use the e command to modify the data from 0021 to: F to 30 h, 31 H, 32 h, 33 H, 34 h, 35 h, 36 h, and 37 h. The modified code should be written correctly.

MoV ax, 0021

MoV ds, ax

MoV ax, 2200

Mox ss, ax

MoV SP 0100

 

MoV ax, [0]; AX = 3130 H

Add ax, [2]; AX = 6462 H

MoV BX, [4], BX = 3534 H

Add Bx, [6]; BX = 6c6ah

 

Push ax; SP = 00feh. The modified memory unit address is 2200: 00fe, And the content is 6462 H.

Push BX; SP = 00fch. The modified memory unit address is 2200: 00fc and the content is 6c6ah.

 

 

 

 

 

 

 

 

Task 2

Record the 7-line command input using the command, use the e command to modify the value from to 200: F, and view the modified part. Run the D command to view the commands in one step.

Observe the change in the value of the Register and consider the cause.

 

 

 

 

 

 

Experiment conclusion:

MoV ax, 2000;

H is stored in the register

MoV SS, ax;

H is stored in the stack segment register

MoV sp, 10;

The function of the first three lines of Assembly commands is to indicate the top of the initialization stack,

Stack top is 2000; 0010

Stack bottom: 2000; 000e

 

Experiment summary and experience:

The number of errors in the second experiment is much less. During the lab exploration process, many results may be different from the expectation, or you may not understand why such a result is displayed.

You need to learn more about how to use various commands.

This experiment involves the interrupt mechanism, which changes the operations of data in the stack.

 

Experiment 2 machine instruction and assembly instruction Programming

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.