- 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.
- mov ax,[bp] Meaning: (AX) = ((ss) *16+ (BP))
- mov Ax,[bp+idata] Meaning: (AX) = ((ss) *16+ (BP) +idata)
- mov Ax,[bp+si] Meaning: (AX) = ((ss) *16+ (BP) + (SI))
- mov Ax,[bp+si+idata] Meaning: (AX) = ((ss) *16+ (SI) +idata)
- Addressing method:
- Direct addressing:
- Expression: [Idata]
- Directly based on constant addressing, expressed as arr[0 in C language]
- Register Indirect Addressing:
- Expression: [bx], [Si], [di], [BP]
- Based on register data addressing, expressed as arr[i in C language]
- Register relative addressing:
- Expression: [Bx+idata], [Si+idata], [Di+idata], [Bp+idata]
- Based on registers and constant addressing, expressed as arr[i+10 in C language]
- Base Address variable addressing:
- expression: [Bx+si+idata], [Bx+di+idata], [Bp+si+idata], [Bp+di+idata]
- based on two registers and a constant address, represented in C language as arr[i+j+5]
- The length of the data to manipulate:
- 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.
- If there is no register, you can specify it yourself:
- mov word ptr [2],1
- mov byte ptr [2],1
- Some designations specify whether the access is a word or a byte by default:
- div means
-
- In Data segment:
- db (Data byte) defines byte-type data, which occupies 1 bytes per 1 data.
- DW (data word) defines font data, which accounts for 1 characters per 1 data, or 2 bytes.
- DD (data double word) defines two-font data, which is 2 characters, or 4 bytes, per 1 data.
- 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