引言
- reg(寄存器)的集合包括:ax,bx,cx,dx,ah,al,bh,bl,ch,cl,dh,dl,sp,bp,si,di
- sreg(段寄存器)的集合包括:ds,cs,ss,es
- bp寄存器的默认段寄存器是ss
寻址方式
8.8伪指令dd
- dd是用来定义dword的,double word双字
实验九代码,实现同一字段不同颜色的显示
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 2H,24H,71H
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,16
xor bx,bx
mov cx,3
mov ax,0B872H
mov es,ax
s1:push cx
mov si,0
mov di,0
mov cx,16
s0:mov al,[si]
mov es:[bx+di],al
inc si
add di,2
loop s0
add bx,160
pop cx
loop s1
;;;;;;;;;;;;;;;;;;;;;
mov si,0
mov bx,0
mov cx,3
s3:mov di,0
push cx
mov cx,16
s2:mov al,[si+16]
mov es:[bx+di+1],al
add di,2
loop s2
add bx,160
add si,1
pop cx
loop s3
mov ax,4c00H
int 21H
code ends
end start