A summary of registers

Source: Internet
Author: User

Tag: Causes address to read the statement through the code snippet font physical instruction

This chapter learns about the register expansion, learning the CPU overview, general registers, the storage of words in registers, assembly instructions: MOV, add, 8086 gives the method of physical address, Segment register CS and instruction pointer register IP these knowledge points. Here I will write one by one what I think is noteworthy in this knowledge point.

1, the CPU has a word length and a bit width of two concepts, the length of the CPU in a unit of time to process the number of bits. This indicator reflects the speed of the CPU's internal operations processing. A bit width represents the data bits that the CPU can transmit once between the external data bus and memory. The X-bit register we often refer to is the CPU's word length.

2, 8086CPU of 14 registers only ax, BX, CX, DX these four general-purpose registers can be split into high eight-bit and low eight-bit two registers.

3, in the Mov and add instructions, two operands should be the same number of bits. That is, the number of bits of data must not be higher than the number of registers before executing the instruction, but after executing the instruction (above the part will be abandoned). As in the Add case, 100H is an incorrect statement.

4, each memory unit in this space has a unique address, this unique address is called the physical address. The 8086 structure shows a physical address, because the 8086 internal registers are 16 bits, and the external address bus width is 20 bits. That is, 8086 can only save 16 bits (64KB), but can transmit 20 bits (1MB). To solve this problem 8086CPU uses a two 16-bit address to synthesize a 20-bit physical address method, the formula is as follows:

Base Address (segment address *16) + offset address = Physical Address

It is worth noting that the segment is only a logical concept, the same physical address can be split into a number of different segment address and offset address combination, according to the need, the address is continuous, the starting physical address of 16 times times a set of internal deposit (not more than 64KB) as a segment to use.

5, Segment Address *16 There is also a more commonly used argument is to move left four bits, where the number of digits refers to the number of bits. The binary form of a numeric value shifts n bits to the left, which is equivalent to multiplying the data by 2 n times. An X-binary data is shifted to the left 1 bits, which is the equivalent of multiplying by X. So the binary left 4 bit is actually hexadecimal left one bit. Example: 20H of data multiplied by 16 will become 200H.

6, CS is the code segment register, used to hold the segment address of the code snippet. IP is the instruction pointer register that holds the offset address of the instruction that the CPU will read in the code snippet. The corresponding physical address of the CS:IP is the instruction that the CPU will read. CS and IP appear in pairs always,(CS) x16 + (IP) = Physical Address of the instruction .

7, the computer work process has the following three steps:

The 1th step: The CPU is based on CS:IP, calculates the physical address, then reads the instruction to the corresponding memory unit and sends it to the instruction buffer.

2nd step: The CPU automatically modifies the IP value, IP = IP + The length of the read instruction, thus preparing for the next instruction read;

3rd Step: Execute the instruction. Go to the 1th step and repeat the process.

8, when the CPU is just starting to work, CS and IP is set to cs=ffffh,ip=0000h. If you want to specify the values for CS and IP, use the instruction CMP to modify their contents.

(1) Simultaneous modification of CS, IP content: JMP segment Address: offset address

(2) only modify the contents of the IP: a valid register in JMP (note that a register is required to assign a value to the IP, and the data cannot be transmitted directly to the IP)

About quit before class I have a small proposal, hoping to give us more time. Every time the problem always feel very hasty, too late to think about the next question, leading to a lot of things will do wrong.

A summary of registers

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.