daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Oct 7th, 2018 200 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 200H
  3. .DATA
  4. Text db "Baka coding desu$"
  5. ResultText db "$"
  6. .CODE
  7. START:
  8.  
  9. mov ax, @DATA
  10. mov ds, ax
  11.  
  12. lea dx, Text
  13. xor ax, ax
  14. mov ah, 09
  15. int 21h
  16.  
  17. xor dx, dx
  18. xor si, si
  19. Parse_Text_loop:
  20. mov al, [Text + si]
  21.  
  22. mov bx, si
  23. sub si, dx
  24. mov [ResultText + si], al
  25. mov si, bx
  26.  
  27. cmp al, '$'
  28. je End_Parse_text_loop
  29.  
  30. cmp al, 'g'
  31. jne Continue_parse_Text_loop
  32. mov ah, [Text + si + 1]
  33. cmp ah, '$'
  34. je Cmp_ah_n
  35. cmp ah, ' '
  36. jne Continue_parse_Text_loop
  37. Cmp_ah_n:
  38. mov ah, [Text + si - 1]
  39. cmp ah, 'n'
  40. jne  Continue_parse_Text_loop
  41. mov ah, [Text + si - 2]
  42. cmp ah, 'i'
  43. jne Continue_parse_Text_loop
  44. mov bx, si
  45. sub si, dx
  46. mov [ResultText + si], ' '
  47. mov [ResultText + si - 1], 'd'
  48. mov [ResultText + si - 2], 'e'
  49. mov si, bx
  50. inc dx
  51.  
  52. Continue_parse_Text_loop:
  53.  
  54. inc si
  55. jmp Parse_Text_loop
  56.  
  57. End_Parse_text_loop:
  58. ; ------ new line
  59. mov dl, 0dh
  60. mov ah, 02h
  61. int 21h
  62. mov dl, 0ah
  63. mov ah, 02h
  64. int 21h
  65. ; ------
  66.  
  67. lea dx, ResultText
  68. xor ax, ax
  69. mov ah, 09
  70. int 21h
  71.  
  72. mov ah, 4ch
  73. mov al, 00h
  74. int 21h
  75.  
  76. END START
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top