Guest User

Untitled

a guest
Nov 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. ;Declaration Part
  2. .MODEL SMALL
  3. .DATA
  4. STR1 DB 09H, "Admin",'$' ; STR1 is the given string to be transferred
  5. STR2 DB ? ; STR2 is the location for the transfer
  6. ST1 DB 09H, "STR1:$" ; To display STR1:
  7. ST2 DB 09H, "STR2:$" ; To display STR2:
  8. LEN DB 0AH ; Length of the String is loaded Here
  9. .CODE
  10. START: MOV AX,@DATA
  11. MOV DS,AX
  12. MOV ES,AX
  13. LEA SI,STR1 ; Location of STR1 is loaded to SI
  14. LEA DI,STR2 ; Location of STR2 is loaded to DI
  15.  
  16. ;To display STR1:
  17. LEA DX,ST1
  18. MOV AH,09H
  19. INT 21H
  20.  
  21. ;To display contents of STR1
  22. LEA DX,STR1
  23. MOV AH,09H
  24. INT 21H
  25.  
  26. ;To display STR2:
  27. LEA DX,ST2
  28. MOV AH,09H
  29. INT 21H
  30.  
  31. ;Transferring Part
  32. CLD ; Clear the contents of Direction Flag
  33. MOV CH,00H ; Since CX should be 00xx
  34. MOV CL,LEN
  35. REP MOVSB ; Repeat the transfer untill CL=0
  36.  
  37. ;To display the transferred contents of STR1 to STR2
  38. LEA DX,STR2
  39. MOV AH,09H
  40. INT 21H
  41.  
  42. ;Program Termination
  43. MOV AH,4CH
  44. INT 21H
  45. END START
Add Comment
Please, Sign In to add comment