Assemble lab report

Source: Internet
Author: User
Tags printable characters

This is the first chapter of the assembly language Machine experiment. The main content of this experiment is to master the methods for compiling and debugging Assembly commands using the debug tool, and to master some basic assembly commands usage and their functions.

I,Establishment of the DOS language development environment:

This shows the DOS configuration file on the local machine, and writes Mount D: \ MASM to the end of the file.

D: Two commands, which can be used to deploy the development environment in the Directory D: \ MASM on the local machine.

 

 

 

The mounted DoS Status is as follows:

 

 

 

Ii. Lab tasks

 

① Use commands E and A to write the commands into the memory respectively:

1) run the e command to modify the register content, and run the D command to view the commands modified in the range of 0: 200-0: 220.

(A small error occurs. When calculating the address length, you forget one character, but it has been fixed)

 

 

The result after disassembly is:

 

 

Note: Using command a cannot directly write machine commands into memory

2) use the command to write the Assembly command, and then run the U command to decompile the machine code of the command.

 

 

 

Conclusion: Like all languages, high-level languages are used to facilitate computer operations. In the final analysis, all languages are eventually converted into machine languages, which are eventually converted into electrical signals: 0, 1.

 

② Use three commands to calculate the power of 2 to the power of 8

The jump function of the JMP command can be used to perform a logarithm loop operation, and a command is used to write data.

MoV ax, 1

Add ax, ax

JMP 2000:0003

For the preceding three commands, the T command specifies the address for starting execution,

 

 

After JMP 7 times, you can get AX = 0100 (16) = 32 (10)

 

 

Here, the value marked in red circles is the hexadecimal value of 32, because the multiplication operation of calculation is commonly used to complement a multiplier, and its essence is the operation of order, through addition such as 2 + 2 = 4; 4 + 4 = 8... 128 + 128 = 256 perform the ascending operation, then the numerical part can be operated in one bit to get the result of 2 ^ 8 = 256

Conclusion: The JMP command can be used for jump operations, which is helpful for calculating the integer power value. During debugging, the T Command needs to be executed in one step. If the G command is used, this will cause the G command to stop working without finding the address. Because every time JMP redirects back to the original address, the content of the address before the G trace t jumps does not execute these commands, so no result is obtained.

 

③ View the content in the memory:

There are several units in the PC Main Memory FFF00H-FFFFFH that have the ROM production date on the motherboard, find this date:

First, you must understand ROM: ROMs is a ROM image (read-only memory image). The meaning of read-only is that the OS can only read some necessary information from it for running the machine, you cannot modify the content. Since the content cannot be modified, you can use the e command to find the unmodifiable unit:

In assembly, the-following the memory unit indicates non-printable characters, which can be clearly identified.

 

 

Here we guess that the red rectangle is marked with the assic code of the production date and the decimal value,

The following uses the e command to modify the content in the memory range, and then run the D command again to view

 

 

After performing the following operations, it is found that the content in the range of fff0: F0 FF cannot be changed, but the displayed content is 01/01/92. Therefore, this is the production date of Rom, January 1, January 1, 1992.

 

Conclusion: The content in ROM is read-only and cannot be modified. The numeric characters in assembly language are stored in the memory in the form of assic code, which is easy to detect when displayed.

④ Fill in data to the Unit in the memory starting from b8100h, for example:

-E b810: 0000 01 01 02 03 03 04 04

The result is as follows:

 

 

The method for controlling variables is displayed after a value is modified:

 

 

Continue the test:

 

 

Therefore, we can see that different values are output, and the color and shape are also different.

 

Conclusion: 8086 of the memory space is a0000h ~ Bffffh, where b8000h ~ Bffffh is 80*25 color character display buffer. when data is written to this address space, the data is immediately displayed on the display. The experiment shows that the display commands appear in pairs, the first command controls the character shape, and the second command controls the color of the character.

 

II,Experiment Summary

This experiment has learned and mastered the use of debug tools and the use of some common assembly commands. For the Compilation itself, the compiler is not as convenient as other advanced language compilers, in dos, the previous page information cannot be conveniently queried, And it is stiff to use. Once a command error occurs, you can only re-type the command. However, if an intermediate command error occurs for a long command set, the result may be abnormal, this problem can be solved only when all the commands are re-typed during debugging. It may be a better solution, but this is my opinion on dos. However, because assemble is a very low-level computer language, understanding the language helps you better understand the computer's operation and usage, and better understand the computer's kernel.

Assemble lab 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.