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 H→0432 H,
Line10Of0436 H→0439 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 H→0333 H,
Line10Of0436 H→0336 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