Assembly Lab 2

Source: Internet
Author: User

(1) use DEBUG to write the above program segments to the memory and execute them one by one. Fill in the blanks based on the actual running conditions of the commands.

E 0021:0 0021:7 30 h, 31 H, 32 h, 33 H, 34 h, 34 h, 35 h, 36 h, 37 h

MoV ax, 0021

MoV ds, ax

MoV ax, 2200

MoV SS, ax

MoV SP 0100

 

MoV ax, [0]; AX = 3130

Add ax, [2]; AX = 6462

MoV BX, [4]; BX = 3534

Add Bx, [6]; BX = 6c6a

 

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

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

Pop ax; SP = 00feh, Ax = 6c6ah

Pop BX; SP = 0100 H, BX = 6462 H

 

Push [4]; SP = 00feh, the modified memory unit address is 2200: 00fe content is 3534

Push [6]; SP = 00fch, the modified memory unit address is 2200: 00fc content is 3736

The above is the result after the lab instruction is executed.

Enter the command as required and use the command.

Experiment 2 programming with machine instructions and assembly instructions

(2) observe the experiment process shown in Figure 3.19 and analyze the cause ~ 2000: will the content in F change?

Input command

Interrupt mechanism. When the debug t command executes the command to modify the SS register, the next command is also executed.

Later, I found out that the interruption process uses the current stack space to store key CPU data. Therefore, some data in your stack is not operated.

MoV SS and ax change the memory address of the stack segment register.

Assembly Lab 2

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.