Experiment 3 programming, compilation, connection, and tracking

Source: Internet
Author: User
1. Exercise 1

Step 2: Compile the Assembly source program t1.asm, as shown in source code 1-1.

 

Step 2: compile, connect, run, and debug the source program t1.asm.

(1) run the program and observe what the program output result is?

As follows:

The result is 3 and 6.

(2) ChangeLine4AndLine9Type registerDLTo0 ~ 9Any number in, Reassemble → connect → run, observe the changes in the results.

 

3) debug the generated Executable File t1.exe with debug.

① Run the R command. Observe the value of Cx in the register, observe the value of DS and CS in the Register, and check whether the relationship between them is satisfied.(CS) = (DS) + 10 h?

Cs = DS + 10

② The first two bytes of PSP (program segment prefix) areCD 20, Use DEBUG to view PSP content and verify whether

So.

Yes

③ Use the U command to disassemble t1.exe and observe the source code obtained from the disassembly.

 

④ Use the T command and the p command (EncounterIntCommandPCommand) One-Step debugging, observe the results.

The numbers are 4 and 7.

Exercise 2:

The execution result is 36 in red.

(2) if (1) the result is verified, re-open t2.asm and tryLine7Of0433 H0432 H,

Line10Of0436 H0439 HAnd then re-assemble and connect to get the executable file t2.exe. UseCLSAfter the command is cleared, observe the program running result again.

(3) if (1) the result is verified, re-open t2.asm and try0433 H0333 H,

Line10Of0436 H0336 HAnd then re-assemble and connect to get the executable file t2.exe. Use the CLS command to clear the screen and observe the program running result again.

 

Comparison between experiment 1 and Experiment 2:

In experiment 1, DL stores the output results,

In experiment 2, the color of the numerical control result stored in BH and the numerical value stored in BL control the result.

In this experiment, because I do not know much about the use of MASM, I will try my best to better understand each method.

Experiment 3 programming, compilation, connection, and tracking

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.