Chapter 2 register (Memory Access) Summary

Source: Internet
Author: User

Storage of words in memory

A memory unit that stores a hex data (16 bits). It consists of two consecutive memory units with two addresses. The high address memory unit stores the high byte of the font data, and the low address memory unit stores the low byte of the font data. The starting address is N.

 

DS and [address]

"[...]" Indicates a memory unit, and "0" in "[...]" indicates the offset address of the memory unit. The 8086cpu automatically retrieves the data in DS as the segment address of the memory unit. The 8086cpu does not support sending data directly to the segment register. It can only use one register for transfer. That is, it first sends H data to a general register, such as BX, then, the content in BX is sent to DS.

 

MoV, add, sub commands

MoV commands can take the following forms:

MoV register, Data

MoV register, register

MoV register, memory unit

MoV register, segment register

MoV memory unit, register

MoV memory unit, segment register

MoV segment register, register

MoV segment register, memory unit

The add command can take the following forms:

Add register, Data

Add register, register

Add register, memory unit

Add memory unit, register

Sub commands can take the following forms:

Sub register, Data

Sub register, register

Sub register, memory unit

Sub memory unit, register

 

 

Stack mechanism provided by CPU

Operation Rules of the later, first, and foremost

Push ax means to send data in the register ax to the stack, and pop ax means to pull data from the top of the stack and send it to ax. The inbound and outbound operations of the 8086cpu are performed in units of words.

8086cpu has two registers: segment register SS and register sp. The segment address at the top of the stack is stored in SS, And the offset address is stored in SP. At any time, SS: SP points to the top element of the stack.

 

 

Push and pop commands

When pushing, the two steps of CPU operation are: First Change sp, and then transfer to SS: sp. When you execute pop, the two-step CPU operation is to read the data at SS: SP first, and then change the SP.

 

Chapter 2 register (Memory Access) 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.