Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. display macro msg
  2. lea dx,msg
  3. mov ah,09h
  4. int 21h
  5. endm
  6.  
  7.  
  8. assume cs:code, ds:data,ss: stack
  9. stack segment
  10. dw 100 dup(0)
  11. top label word
  12. stack ends
  13. data segment
  14. str1 db 0ah,"enter string1:$"
  15. str2 db 0ah,"enter string2:$"
  16. str3 db 50 dup('$')
  17. str4 db 50 dup('$')
  18. str5 db 0ah,"Not equal$"
  19. str6 db 0ah," equal$"
  20. data ends
  21.  
  22.  
  23. code segment
  24. start: mov ax,data
  25. mov ds,ax
  26. mov es,ax
  27. display str1
  28.  
  29. lea si,str3
  30. mov cl,0
  31. loop1: mov ah,01h
  32. int 21h
  33. cmp al,0dh
  34. je ext
  35. inc cl
  36. mov [si],al
  37. inc si
  38. jmp loop1
  39.  
  40. ext: display str2
  41. lea si,str4
  42. mov bl,0
  43. loop2: mov ah,01h
  44. int 21h
  45. cmp al,0dh
  46. je ext1
  47. inc bl
  48. mov [si],al
  49. inc si
  50. jmp loop2
  51.  
  52. ext1: mov ch,0
  53. mov bh,0
  54. cmp bx,cx
  55. jnz no
  56.  
  57. lea si, str3
  58. lea di,str4
  59. CLD
  60. REPZ cmpsb
  61.  
  62. jz disp1
  63. no: display str5
  64. jmp stp
  65.  
  66. disp1: display str6
  67.  
  68. stp: mov ah,01h
  69. int 21h
  70.  
  71. mov ah,4ch
  72. int 21h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement