| 
 | 
 
 
 楼主 |
发表于 2014-8-20 15:59:45
|
显示全部楼层
 
 
 
费了好几个小时,找到问题改好了:loveliness: 
 
- assume cs:codesg,ds:datasg,ss:stacksg
 
  
- datasg segment
 
 - db 'Welcome to masm!'
 
 - db 02h,24h,71h
 
 - datasg ends
 
  
- stacksg segment
 
 - dw 8 dup(0)
 
 - stacksg ends
 
  
- codesg segment
 
  
-  start:
 
 -         mov ax,datasg
 
 -                 mov ds,ax
 
 -                 mov ax,stacksg
 
 -                 mov ss,ax
 
 -                 mov ax,0b872h
 
 -                 mov es,ax
 
 -                 mov bx,0
 
 -                 mov di,0
 
 -                 mov si,16
 
 -             mov cx,3
 
 -                 
 
 -         
 
  
-    s0:  push cx
 
 -                 push si
 
 -                 push di
 
 -                 push bx
 
 -         
 
 -              mov cx,16
 
 -         s:        mov al,[bx]
 
 -                 mov es:[di],al
 
 -                 
 
 -                 mov ah,[si]
 
 -                 mov es:[di+1],ah
 
 -                 
 
 -                 add di,2
 
 -                 add bx,1
 
 -                 loop s
 
 -                 
 
 -                 pop bx
 
 -                 pop di
 
 -                 pop si
 
 -                 pop cx
 
 -                 add di,160
 
 -                 add si,1
 
 -                 
 
 -                 loop s0
 
 -                 
 
 -  
 
 -                 mov ax,4c00h
 
 -                 int 21h
 
 -                 
 
 -                 codesg ends
 
 - end start
 
  
-                 
 
  复制代码 |   
 
 
 
 |