Addressing data compiled

Addressing Data

Immediate addressing

Directly behind the operand contained in the instruction immediately following the machine code opcodes

E.g

Explanation: transferring operand back to the ax, al register

mov ax,0a7fh
mov al,5h

Register Addressing

Operand is a register operand (16-bit 16-bit, 8-bit 8)

Explanation: The number of a register to another register

mov ax,bx
mov dl,cn

Memory Addressing

Direct addressing

Explanation: the two operands in the memory segment data ds (default) address corresponding to the transmission 16 configured to give ds register ax

 mov ax,[2000h]//通过ds数据段和偏移地址2000h求得物理地址,把该物理地址的内容传送到ax中
 非默认时:mov ax,es:[2000h]//指定了数据段

Seeking physical address: If ds = 3000h, then the memory address is shifted left four plus ds [] Inside the Address

Register indirect addressing

[] Which may be a register bx, bp, si, di

bx, si, di corresponding data segment register is ds, and corresponds to bp ss

mov ax,[bx]//物理地址=ds*16+bs
mov bx,[si]//物理地址=ds*16+si
mov [di],dx//物理地址=ds*16+di 这个是反向传,把寄存器内容传送到内存
mov [bp],bx//物理地址=ss*16+bp

Also you can use these registers except register opening

E.g

mov ax,es:[bx]//物理地址=es*16+bx
mov ds:[bp],dx//物理地址+ds*16+bp

Relative register addressing

mov ax,3003h[si]//ax<-[si+3003h]  假如ds=3000h 则物理地址=3000h*10h+si+3003H
mov si,08h[bx]//物理地址=ds*16+bx+08h
mov ax,[bx+100h]//物理地址=ds*16+bp+100h
mov al,[bp+o8h]//物理地址=ss*16+bp+08h
mov 0200h[bp],ax//物理地址=ss*16+bp+0200h

Base address, indexed addressing

ea = base address register the contents of index register +

mov ax,[bx][si]//物理地址=ds*10h+bx+si

Opposing base address / indexed addressing

On the basis of the addressing mode on a plus or minus bit shift amount 16/8

mov ax,mask[bx][si]//物理地址=ds*10h+bx+si+mask

Guess you like

Origin www.cnblogs.com/chenguosong/p/11764400.html