Maruf_Hasan

Untitled

Oct 28th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ; You may customize this and other start-up templates;
  2. ; The location of this template is c:\emu8086\inc\0_com_template.txt
  3.  
  4. org 100h
  5.  
  6. lea si,input
  7. lea di,output
  8.  
  9. mov bx,0
  10.  
  11. mov cx,len
  12. next:
  13. cmp [si],' '
  14. je n1
  15. inc count
  16. jmp stop
  17. n1:
  18. cmp bx,count
  19. jae skip
  20. store:
  21. mov bx,count
  22. mov count,0
  23. mov ax,len
  24. sub ax,cx
  25. mov dx,ax
  26. skip:
  27. mov count,0
  28. stop:
  29. inc si
  30. loop next
  31.  
  32. cmp bx,count
  33. jb block2
  34.  
  35. sub si,len
  36. add si,dx
  37. dec si
  38. mov cx,bx
  39. dec bx
  40. add di,bx
  41.  
  42. block:
  43. mov al,[si]
  44. mov [di],al
  45. dec di
  46. dec si
  47. loop block
  48. jmp en
  49.  
  50.  
  51. block2:
  52. add di,count
  53. mov cx,count+1
  54. b23:
  55. mov al,[si]
  56. mov [di],al
  57. dec di
  58. dec si
  59. loop b23
  60. en:
  61. ret
  62.  
  63. input db 'My is asdfghh blue'
  64. len equ ($-input)
  65. output db ?
  66. count dw 0
Advertisement
Add Comment
Please, Sign In to add comment