The followingProgramThe function is to copy the commands before "mov ax, 4c00h" to the memory at and complete the program. Debug the machine and track the running results.
Assume Cs: Code
Code segment
MoV ax ,--?
MoV ds, ax
MoV ax, 0020 H
MoV es, ax
MoV BX, 0
MoV CX ,--?
S: mov Al, [BX]
MoV ES: [BX], Al
INC BX
Loop s
MoV ax, 4c00h
Int 21 h
Code ends
End
Tip:
(1) What is the replication? From where to where?
(2) What is the replication? How many bytes are there? How do you know the number of bytes to be copied?
Analysis:
Empty: CS. Because we started from CS: IPCodeInput.
2 blank: 17 h.
// This visual test has a big problem. Everyone wants to find the register or the data, and so on, and can directly find the total number of bytes to be copied.
In fact, we only need to give CX a small value first. Then debug and run. View the Cx value. -5 h is the result we need.
// The reason for-5 is that mov ax, 4c00h, and INT 21 h have a length of 5;
It took nearly an hour for beginners to compile the Assembly. The original answer was so strange.
I can't help myself ..