Assembly language (Wang Shuang) 1th Chapter Basic Knowledge

Source: Internet
Author: User

1.1 Machine language

Machine language is the set of machine instructions. What is a machine instruction? is a column of binary data, the computer turns it to high and low level, so that the other devices of the computer drive and operation. (How does the computer use the 2-in language?) )

Early procedures are written in machine language, but there is a problem is too much trouble, the data information is too long, write a wrong 0 or 1 will come to the bug.

This machine language is not written by people, it is doomed to be eliminated.

1.2 Assembly language

At this time, assembly language came forward.

Assembly language is the easy-to-remember format of machine languages

An instruction 1000100010001000 means that the contents of the register A1 to the register A2. As follows

Operation Description: The contents of the register A1 to the Register A2

Machine code: 1000100010001000

Assembly code: MOV A1,A2

is not a glance to understand the assembly, move a1,a2.

Here's a a1,a2 of what these registers are.

Registers are the areas where data is stored in the CPU, and one CPU has multiple registers

However, you write the assembly language, the computer does not know Ah, so the assembly language is to turn into machine language, that is, those 2 code, so that the computer can understand. How do you turn it?

Use the assembler compiler. Assembly code is compiled into machine code.

1.3 Composition of assembly language

There are 3 parts that make up

    1. Assembly instructions (with corresponding machine code)
    2. Pseudo-directive
    3. Other symbols

1.4 Memory

i.e. memory

A CPU wants to work and must provide him with instructions and data.

Both instructions and data exist in memory

The hard disk and memory are not the same, instructions and data can exist on the hard disk, but do not read into memory, can not be used by the CPU. That's why the same amount of memory is more expensive than the hard disk, because the CPU can read the memory directly, and the hard disk will have to go through memory to read the memory and have buffer time.

There is CPU and memory to match well, get a I7 CPU and 1G of memory, I7 is overqualified.

1.5 directives and data

Instructions and data in memory and hard disk in the form of the same is actually the same, is a string of 2 binary code.

However, for the CPU, you can distinguish between different 2-based code. Some are understood as instructions, and some are understood as data.

such as 1000100010001000, when the data, press 2 to go to the 10 binary, when the instruction is the front of the mobile A1 content to A2.

1.6 Storage Units

Memory is divided into multiple storage units, and each storage unit has a unique address and corresponds to it.

A storage unit can store one byte

1.7 CPU to read and write memory

The CPU can read and write to the memory address space. The memory address space is the collection of addresses for the memory.

To read and write to all types of memory, you must have the following 3 steps

1 addresses found (address information)

2 find the corresponding device and know read or write (control information, including control object (device) and operation form (read and write))

3 Read and write data (data information)

How to put the above address information, control information, data information to the memory chip, with the bus.

are address bus, control bus, data bus, respectively.

The following examples illustrate the following

The in-memory reading process uses the address line first, then the control line, and then uses the data line to transfer the data from unit 3rd to the CPU.

1.8 Address Bus

The address bus can transmit n different information, then can be addressed to n addresses, that is, the corresponding n memory units.

A CPU has n address bus, then the width of the address bus of this CPU is N, can find the memory unit is 2 of the n-th square.

1.9 Data Bus

The data transmitted by the CPU and other devices is

The width of the data bus determines the speed of the transmission

8 Data bus to pass 1 bytes at a time

16 Data Bus passes 2 bytes at a time, etc.

1.10 Control Bus

Indicates that the CPU can be controlled more than several external devices

1.11 Memory address space (Overview)

So a collection of memory chip addresses, such as the first picture of this article.

1.12 Motherboard

The motherboard has CPU, memory, expansion card slots, and so on, these things with 3 kinds of bus link together.

Expandable memory strips and various interface cards in the expansion card slot

1.13 Interface Card

Interface card plug In other devices, such as monitors, stereos, printers, etc.

CPU via bus Control interface card, interface card control peripherals via bus

1.14 Various memory chips

CPU to link various memory chips.

Ram means that the memory is readable and writable, and this data cannot be saved. Shut down, it's gone.

ROM indicates that the memory is readable only. The data is off and there's a

That's about as much, EOF.

Assembly language (Wang Shuang) 1th Chapter Basic Knowledge

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.