Assembly Language Learning Notes (eight) two basic problems in data processing
Source: Internet
Author: User
1.bx,si,di,bp
Use: Reg to represent registers, Sreg to represent segment registers
Reg:ax,bx,cx,dx,ah,al,bh,bl,ch,cl,dh,cl,sp,bp,si,di
Sreg:ds,ss,cs,es
Only four registers in 8086 can be placed in the middle of [] as a memory unit addressing
BP and Bx, Si and di are not combinable, and the rest can be
BP: As long as the use of BP in [], and no display of the given segment address, the segment address is the default in the SS
DS->BX (default)
SS->BP (default) but you can force the display to give
assembly language Expression Data location:
1. Instantly count Idata mov ax,1
2. Register mov AX,BX
3. Segment address and offset address mov ax,[bx]/[bp]
2. How long does the instruction process data
In the machine instruction, indicate whether the instruction is a word operation or a byte operation.
1. Specify the size of the data to be processed by the register name: Ax:16;al:8 bit
2. If no register name exists, use: Word ptr or byte ptr
3. Other methods: Some directives default on whether to access their own units or their own units
Push, pop: operate on words only
3.DIV Instruction: Division.
Divisor: 8-bit or 16-bit, in register or memory unit
Divisor: Default in AX or DX and ax
When the divisor is 8 bits, the divisor is 16 bits (AX)
When the divisor is 16 bits, the divisor is 32 bits (DX+AX)
Results: Operation 8 bits, quotient in AL, remainder in AH
Operations 16 bits, quotient in ax, remainder in DX
div byte ptr ds:[0]
Meaning:
(a1) = (Ax)/((DS) *16+0)
(AH) = remainder of (AX)/((DS) *16+0)
div Word prt es:[0]
Meaning: *10000h is represented by multiplying by a 16-bit, four 0000 representing a 16-bit
(AX) =[(DX) *10000h+ (AX)]//((DS) *16+0)
remainder of (DX) =[(DX) *10000h+ (AX)]//((DS) *16+0)
4. Pseudo-directive: Dd:dword
Double Word dual-font data
Db
DW can be accommodated with a DW as long as it is not more than 2^16
Dd
5.dup operator: In assembly language, the same as DB, DW, DD, etc., also has the compiler to recognize the processing of matching
DUP repeat
DB 3 dup (0): 3 bytes defined, their values are 0, equivalent to db0,0,0
DB 3 dup (0,1): 6 bytes defined, equivalent to DB 0,1,0,1
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.