Advertisement
Shakken

Untitled

Jan 4th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. msg1 db 0Ah,0Dh,"Enter string <80(char)",0Ah,0Dh,'$'
  5. string db 80 dup(?)
  6. msg2 db 0Ah,0Dh,"Reversing string",0Ah,0Dh,'$'
  7. .code
  8. start: mov ax,@data
  9. mov ds,ax
  10. lea dx,msg1
  11. mov ah,09h
  12. int 21h
  13. mov cx,80
  14. xor si,si
  15. l1: mov ah,01h
  16. int 21h
  17. cmp al,0Dh
  18. je continue
  19. mov string[si],al
  20. inc si
  21. loop l1
  22. continue: mov ah,09h
  23. lea dx,msg2
  24. int 21h
  25. cmp si,0
  26. je exit
  27. dec si
  28. mov cx,si
  29. l2: mov si,cx
  30. mov dl,string[si]
  31. mov ah,02h
  32. int 21h
  33. loop l2
  34. mov dl,string[0]
  35. mov ah,02h
  36. int 21h
  37. exit:
  38. mov ah,4Ch
  39. int 21h
  40. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement