Programming with machine instructions and assembly instructions (1) Experimental report

Source: Internet
Author: User

Experimental conclusion

Lab missions (1)

1. Write instructions to memory using the e command

First use the e command to the memory unit starting from 1000:0 to write the task requirements of the machine code, and then use the R command to see the register status in the CPU, you can see, CS=073FH, ip=0100h, point to memory 073f:0100, and then use the R command to modify CS, IP content, so that CS : IP points to 1000:0. Then use the T command to execute the instructions written, after executing the t command, 1000:0 Instructions B8 4e (mov ax,4e20h) are executed. After the instruction is executed, the content in Ax is rewritten to 4e20h,ip changed to ip+3 (since the MOV ax,4e20h instruction length is 3 bytes), Cs:ip refers to the next instruction. Then continue with the T command to execute one by one, the last cs:ip point to 1000:0021, indicating the total length of the instruction is 21 bytes.

2. Write instructions to memory with a command

Use the a command to write the assembly instructions for the task request to a memory unit starting with 1000:0, as in the other operation.

Lab Missions (2)

First, use the a command to write the instruction required by the task to a memory unit starting at 2000:0, and then execute the instruction from 2000:0 with the T command and execute 8 times to get the result ax=0100h.

Lab Missions (3)

Data representing the date of production is stored in FFF0:00F6 to fff0:00fe memory units, their ASCII code meaning is 01/01/92.

Lab missions (4)

Write the data with the e command, and then use the D command to read the data.

Changes after filling in the data, the second time you use the D command, the memory unit does not display the data previously stored with the e command, but other data. Change fill address does not change.

Experiment Summary and experience

Through this experiment, I basically mastered the method written using the Debug tool and a few basic debug assembly commands. This experiment let me realize the importance of the machine operation, but the knowledge in the classroom is far from enough, the machine after the discovery of some operations to learn more.

In the experiment, I also encountered some difficulties, such as: Debug line space is limited, can not input a large amount of data at a time. In the Experiment Task (1), I use the e command to write instructions to memory, because the machine code is too verbose, can not be entered in the same line, but the auto-wrap can not continue to input, only the code into two parts of the input execution, which wasted some time. This also makes me realize the advantages and convenience of assembly instruction relative to machine code.

Programming with machine instructions and assembly instructions (1) Experimental report

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.