Advertisement
Guest User

likiDebager

a guest
Nov 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. ; multi-segment executable file template.
  2.  
  3. data segment
  4. ; add your data here!
  5. stringa db 50 dup(?)
  6. stringa_nov db 50 dup(?)
  7. stringb db 50 dup(?)
  8. stringb_nov db 50 dup(?)
  9. transformations db 0
  10. isti db "isti se$"
  11. razlicni db "ne se isti$"
  12. ends
  13.  
  14. stack segment
  15. dw 128 dup(0)
  16. ends
  17.  
  18. code segment
  19. start:
  20. ; set segment registers:
  21. mov ax, data
  22. mov ds, ax
  23. mov es, ax
  24.  
  25.  
  26.  
  27. ; add your code here
  28. lea bx, stringa
  29. push bx
  30. call citaj
  31. lea dx, stringa_nov
  32. push dx
  33. mov si, bx
  34. push si
  35. call transform
  36.  
  37. pop dl
  38. mov dh, 0
  39. lea al, transformations
  40. mov ah, 0
  41. add dl
  42. mov al, tranformations
  43.  
  44. lea bx, stringb
  45. push bx
  46. call citaj
  47. lea dx, stringb_nov
  48. push dx
  49. mov si, bx
  50. push si
  51. call transform
  52.  
  53. pop dl
  54. mov dh, 0
  55. lea al, transformations
  56. mov ah, 0
  57. add dl
  58. mov al, tranformations
  59.  
  60. call sporedi
  61.  
  62. mov ax, 4c00h ; exit to operating system.
  63. int 21h
  64.  
  65. transform proc:
  66. pop dx ;IP
  67. pop si ; stringa
  68. pop di ; stringa_nov
  69.  
  70. mov bl, 0
  71.  
  72. l1:
  73. lodsb
  74. cmp al, 96
  75. jg store
  76. add al, 32
  77. inc bl
  78. store:
  79. stosb
  80. loop l1
  81. push bl
  82. push dx
  83. ret
  84. transfrom endp
  85.  
  86. citaj proc:
  87. pop dx
  88. pop di
  89.  
  90. l2:
  91. mov ah, 1
  92. int 21h
  93. cmp al, 24h
  94. je prodolzi
  95. stosb
  96. loop l2
  97.  
  98. prodolzi:
  99. push dx
  100. ret
  101. citaj endp
  102.  
  103. sporedi proc:
  104. pop dx
  105. lea si, stringa_nov
  106. lea di, stringb_nov
  107. repe cmpsb
  108. jne else
  109. lea dx, isti
  110. mov ah, 9
  111. int 21h
  112.  
  113. else:
  114. lea dx,neisti
  115. mov ah, 9
  116. int 21h
  117.  
  118. push dx
  119. ret
  120. sporedi endp
  121.  
  122.  
  123. ends
  124. lodsb
  125. end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement