Advertisement
Farhana_Zaman

Untitled

Jul 15th, 2023
2,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                                                       .stack 100h
  2. .model small  
  3. .data
  4.     arr dw 1, 2, 4, 5, 6  
  5.     newarr dw 6(?)
  6.    
  7.        
  8. .code
  9.     main proc
  10.         mov ax, @data
  11.         mov ds,ax  
  12.         mov es, ax
  13.        
  14.         ;coping to new array
  15.         lea si, arr
  16.         lea di, newarr
  17.         cld
  18.         mov cx, 5  
  19.         rep movsw
  20.          
  21.         ;now move value like before
  22.         std
  23.         lea si, newarr+8
  24.         lea di, newarr+10
  25.         mov cx,3
  26.         rep movsw
  27.         mov word ptr [di], 3
  28.          
  29.         mov cx, 6
  30.         xor si, si  
  31.        
  32.                
  33.         ;print new array            
  34.         lop2:
  35.             mov dx,newarr[si]
  36.             add dx,48
  37.             mov ah,2
  38.             int 21h
  39.                
  40.             add si,2
  41.             loop lop2
  42.        
  43.         main endp
  44.     end
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement