王爽《汇编语言》实验13(1)

assume cs:code ds:data
data segment
 db "welcome to masm!",0
data ends
code segment
 start:mov ax,cs
       mov ds,ax
       mov si,offset showstr

       mov ax,0
       mov es,ax
       mov di,200h

       mov cx,offset showstrend-offset showstr
       cld
       rep movsb

       mov word ptr es:[7ch*4],200h
       mov word ptr es:[7ch*4+2],0

       mov dh,10
       mov dl,10
       mov cl,2
       mov ax,data
       mov ds,ax
       mov si,0
       int 7ch

       mov ax,4c00h
       int 21h

 showstr:push ax
         push cx
	 push es
	 push ds
	 push si
	 push di

         mov ax,data
         mov ds,ax
	 mov si,0

	 mov ax,0b800h
	 mov es,ax
	 
	 mov ax,0
	 mov al,160
	 mul dh
	 mov di,ax
	 mov ax,0
	 mov al,2
	 mul dl
	 add di,bx
           
	   mov al,cl
  showstr1:mov cl,ds:[si]
           mov ch,0
	   jcxz ok
	   mov ch,al
	   mov es:[di],cx
	   inc si
	   add di,2
	   jmp short  showstr1
      ok:pop di
         pop si
	 pop ds
	 pop es
	 pop cx
	 pop ax
         iret
  showstrend:nop
code ends
end start


猜你喜欢

转载自blog.csdn.net/weixin_41944412/article/details/80503791