Beginner's assembly-Chapter 1 and Chapter 2 Summary

Source: Internet
Author: User

Original post

Https://sst.st/p/560

 

This article summarizes Unit 1, Unit 2, and Unit 3.

Because I did not take the first few lessons, I may not be able to summarize them correctly in the first unit. Try to follow the instructor's courseware.

Summarychap. I basis

Chapter 1 is a basic computer, or can it be said that the computer composition principle is a super simple version?

Machine language

Silly Binaries

Computers can identify and execute them directly.Not for people.

Different types of computers have different machine languages. programs compiled according to certain computer machine commands cannot be executed on another computer.

Assembly Language

Silly String replacer

The subject is an assembly instruction, which is easy to remember and use.

A mechanical language is a collection of mechanical commands, and an assembly language is a symbolic Form of Mechanical commands.

Each particular assembly language corresponds to its specific machine language instruction set. (Versatility is still low)

Computer System

Take a look at the computer composition principles if you have time.

Storage Unit

-

Bus

It is also called "intuitive bus.

If the main board is a city, the bus is like a bus in the city, which can be transmitted back and forth on a fixed route. These lines can transmit only one bit at a time. Therefore, more data can be sent only when multiple lines are used at the same time, and the number of data that can be transmitted simultaneously on the bus is called the width. The larger the bus width, the better the transmission performance.

Generally, a PC has five types of buses *:

  1. Data Bus: Transfers back and forth data to be processed or stored between the CPU and ram.
  2. Address Bus: used to specify the address of data stored in RAM (random access memory.
  3. Control Bus: transmits the signal of a microprocessor control unit to peripheral devices. Generally, USB bus and 1394 bus are used.
  4. Extended Bus: connects expansion slots and computers.
  5. Local Bus: an extended bus that replaces higher-speed data transmission.

* In Wikipedia, there are five bus types, and there are only the first three types of textbooks.

Memory Address Space

Virtual Address Space?

The modern Memory Management Unit separates virtual address spaces in the form of pages. Through the bus, the CPU treats various types of memory as a logical memory.

It is similar to mounting each memory to an address space so that it has a unique address (PATH ).

Chap. II registersummery

Register

Faster than in CPU

Font length and width

Word Length: the number of binary digits that the CPU can process once per unit time, reflecting the speed at which the CPU internal operations are processed.

Bit Width: The data bit that the CPU can transmit at one time between the external data bus and the memory.

ProbablyHighway Toll StationAndHighway Lane count.

Main registers

Four of them, ax, BX, CX, dx, can also be accessed as twice as listen 8-bit registers.

4: ax, BX, CX, DX

You can also use AH and Al to access the high and low levels of general-purpose registers.

It seems strange to translate main registers into General registers.

CS & IP

The arrangement of textbooks is really messy.

Why?Chapter 2 PPT 12thWhich of the following is the 16-Bit Width of the 8086cpu?

8086 Data Bus 16-bit, address bus 20-bit.

There are also three 16-bit segment registers (see figure) that allow the 8086 CPU to access one megabyte of memory in an unusual way. rather than concatenating the segment register with the address register, as in most processors whose address space exceeds their register size, the 8086 shifts the 16-bit segment only four bits left before adding it to the 16-bit offset (16 × segment + offset ), therefore producing a 20-bit external (or valid tive or physical) address from the 32-bit segment: Offset pair. as a result, each external address can be referred to by 212 = 4096 different segment: Offset pairs.

That is, use

Segment * 0x10 + offset = address

IMB addressing.

 

Modify the cs ip address at the same time

jmp segment:offsetjmp segment:offsetjmp segment:offset

Modify IP only

jmp registerjmp registerjmp register

You cannot use mov IP, ax. The important thing is three times.

Debug

Common commands

I have nothing to say. If you have any questions, just try again?

  • REgister
    View registers
  • DUMP
    View memory
  • ENter
    Modify memory
  • UNassemble
    Disassembly
  • TRace
    One-step execution
  • ASsemble
    Compile an assembly
Etc

SegmentIt's really a good ending.

 

I have learned a good C/C ++ Disassembly tool, godbolt, before learning assembly. If you like it, try it.

References
  1. Https://en.wikipedia.org/wiki/Intel_8086
  2. Http://www.cnblogs.com/zyx20171346065/p/9696999.html
  3. Https://zh.wikipedia.org/wiki/%E6%80%BB%E7%BA%BF
  4. Https://en.wikipedia.org/wiki/Memory_address
  5. Https://www.youtube.com/watch? V = yolmosxxgfw
  6. Https://en.wikipedia.org/wiki/Word_ (computer_architecture)

 

Beginner's assembly-Chapter 1 and Chapter 2 Summary

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.