"Assembly Language (3rd edition) Wang Shuang" chapter eighth study content

Source: Internet
Author: User

  1. As long as the register BP is used in [], and the instruction does not explicitly give the segment address, the segment address is in the SS by default.
    1. mov ax,[bp] Meaning: (AX) = ((ss) *16+ (BP))
    2. mov Ax,[bp+idata] Meaning: (AX) = ((ss) *16+ (BP) +idata)
    3. mov Ax,[bp+si] Meaning: (AX) = ((ss) *16+ (BP) + (SI))
    4. mov Ax,[bp+si+idata] Meaning: (AX) = ((ss) *16+ (SI) +idata)
  2. Addressing method:
    1. Direct addressing:
        1. Expression: [Idata]
        2. Directly based on constant addressing, expressed as arr[0 in C language]
    2. Register Indirect Addressing:
        1. Expression: [bx], [Si], [di], [BP]
        2. Based on register data addressing, expressed as arr[i in C language]
    3. Register relative addressing:
        1. Expression: [Bx+idata], [Si+idata], [Di+idata], [Bp+idata]
        2. Based on registers and constant addressing, expressed as arr[i+10 in C language]
    4. Base Address variable addressing:
        1. expression: [Bx+si+idata], [Bx+di+idata], [Bp+si+idata], [Bp+di+idata]
        2. based on two registers and a constant address, represented in C language as arr[i+j+5]
  3. The length of the data to manipulate:
    1. If there are registers on either side of the operator, the size of the register determines whether the operation is a word or a byte.
    2. If there is no register, you can specify it yourself:
        1. mov word ptr [2],1
        2. mov byte ptr [2],1
    3. Some designations specify whether the access is a word or a byte by default:
  4. div means
  1. In Data segment:
    1. db (Data byte) defines byte-type data, which occupies 1 bytes per 1 data.
    2. DW (data word) defines font data, which accounts for 1 characters per 1 data, or 2 bytes.
    3. DD (data double word) defines two-font data, which is 2 characters, or 4 bytes, per 1 data.
  2. Question 8.1
1000010datasg ends CODESG Segmentstart:mov ax,datasgmov ds,  Axmov dx,ds:[2]; Note high in the low back mov ax,ds:[0]div word ptr ds:[4 ]mov ds:[6],ax  codesg endsend start

"Assembly Language (3rd edition) Wang Shuang" chapter eighth study content

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.