"Assembly language" summary 02--[BX] and loop instructions

Source: Internet
Author: User

[BX] and [0] somewhat similar, [0] represents a memory unit, its offset address is 0, the same [BX] also represents a memory unit, its offset address in BX.

Loop, the English word "loop" has a circular meaning, obviously this instruction is related to the loop.

We agree that the symbol idata represents a constant, one thing to note here is that it is not possible to send a idata data directly into the segment register , which is illegal, and we can put the idata data into the Universal register first, The data in the General register is then mov to the segment register.

Debug and Assembler compiler MASM different processing of instructions:

    1. Debug will interpret [Idata] as an offset address

    2. MASM will interpret [idata] as an actual value idata

Segment prefix:

Instruction mov AX,[BX]

The offset address of the memory unit is given by BX, while the segment address is in DS by default, MOV ax,ds:[bx]

These appear in the instruction that accesses the memory unit, which is used to indicate "DS:", "CS:", "SS:", "es:" that indicate the segment address of the memory unit, and these are all referred to as segment prefixes.

A safe space:

In a normal PC, DOS and other legitimate programs do not generally use the 0:200~0:2FF 256-byte space, so we call this space safe.

Use of segment prefixes:

650) this.width=650; "title=" 0.png "alt=" wkiom1j4pf6ysx67aab9yxilb7a167.png-wh_50 "src=" https://s5.51cto.com/ Wyfs02/m01/91/c4/wkiom1j4pf6ysx67aab9yxilb7a167.png-wh_500x0-wm_3-wmp_4-s_3553888335.png "/>

Summary complete!

This article is from the "where No Play" blog, please be sure to keep this source http://liaofan.blog.51cto.com/12295212/1917697

"Assembly language" summary 02--[BX] and loop instructions

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.