Experiment 3 command Experiment (1)
[PURPOSE]
1. grasp the meaning of commands to further deepen understanding of commands;
2. Master how to use Turbo debugger to debug the program.
[Lab content]
1. Rewrite example 3.81, find result unit save 1, and not save 0.
3.81 strings with a string of L characters are stored in the storage area with the first address ascii_str. If you want to find the "space" (ASCII code: 20 h) character in the string, continue to execute if you find it (Num unit is set to 1 ); if not found, go to not_found (Num unit is set to 0) for execution. Compile the program to implement this requirement as follows:
MoV CX, l
MoV Si,-1
MoV Al, 20 h
Next:
INC Si
CMP Al, ascii_str
Loopne next
Jnz not_found
.
.
.
Not_found:
.
.
.
2. TD verification example 3.57, example 3.58, 3.61.
3.57 shielding 0 and 1 is required. Use the and command and set the constant 0fch.
MoV Al, 0bfh
And Al, 0fch
3.58 requires 5th location 1, available or command
MoV Al, 43 H
Or Al, 20 h
3.61 if the XOR command is required to reverse some digits of the operand, you only need to set the corresponding position of the number segment of the source operand to 1. If you want to change the bitwise of 0th and 1, run the following command:
MoV Al, 11 h
XOR Al, 3
3. Use TD verification example 3.29 and example 3.30 to check SP changes. assign a value to ax Before debugging.
When no value is assigned:
After assignment:
4. Run the following commands in one step to observe data changes in the ax, BX, SP, and stack regions.
MoV ax, 1234 H
MoV BX, 5678 H
PUSH AX
Push BX
MoV ax, 0 abcdh
MoV BX, 55aah
Pop BX
Pop ax
[Experiment Summary]
1. Change the space to 20 h.
2.
Note:
0bh
0ffh
- -1 input: 0 FFFF
- Result output position:
If 01 is found, the storage location is 0210
If 00 is not found: 0210
Experiment 3 command Experiment (1)