si和di是8086CPU中和bx功能相近的寄存器,si和di不能够分成两个8位寄存器来使用。

用si和di实现将字符串"welcome to masm!"复制到它后面的数据区中。

assume cs:codesg,ds:datasg

datasg segment
     db  'welcome to masm!'
     db  '..........................'
datasg ends

codesg segment

start:
                 mov ax, datasg
                 mov ds,ax
                 mov si,0
                 mov cx,8

s:
                  mov ax,0[si]
                  mov 16[si], ax
                  add si,2
                  loop  s

                  mov ax,4c00h
                  int 21h
     
codesg ends

end start

 

posted on 2018-11-06 16:38  迷心迷  阅读(420)  评论(0编辑  收藏  举报