Advertisement
Farhana_Zaman

Untitled

Jul 15th, 2023
2,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; example 11.1
  2. ;reverse copy string
  3.  
  4. .stack 100h
  5. .model small  
  6. .data
  7.     str1 db 'HELLO'
  8.     str2 db 5 dup(?)
  9.    
  10.        
  11. .code
  12.     main proc
  13.         mov ax, @data
  14.         mov ds,ax
  15.         mov es,ax
  16.        
  17.         lea si, str1+4
  18.         lea di, str2
  19.         std
  20.         mov cx, 5  
  21.        
  22.         move:
  23.             movsb
  24.             add di,2
  25.             loop move
  26.          
  27.         mov cx, 5
  28.         xor si, si          
  29.                      
  30.         lop2:
  31.             mov dl,str2[si]
  32.             mov ah,2
  33.             int 21h
  34.                
  35.             inc si
  36.             loop lop2
  37.        
  38.         main endp
  39.     end
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement