马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
code segment
start:
;----将0号中断的程序地址设置为:0:200
;----将cs:d0处的长度为d0end-d0的数据拷贝到0:200处---
mov ax,0
mov ds,ax
mov ds:[2],ax
mov ax,200h
mov ds:[0],ax
mov ax,0
mov es,ax
mov di,200h
mov ax,cs
mov ds,ax
mov ax,d0
mov si,ax
mov cx,offset d0end - offset d0
cld
rep movsb
mov ax,4c00h
int 21h
;----触发0号中断后,显示Welcome to masm!----
d0:
jmp d0start
db "Welcome to masm!"
d0start:
mov ax,0b800h
mov es,ax
mov ax,0a0h*5
;mov bl,5
;mul bl
add ax,48
mov di,ax
mov ax,cs
mov ds,ax
mov si,202h
mov cx,10h
s:
mov al,ds:[si]
mov es:[di],al
inc di
mov al,2
mov es:[di],al
inc si
inc di
loop s
mov ax,4c00h
int 21h
d0end:
nop
code ends
end start
movsb 真的好用,省事啊 |