Advertisement
green1ant

asd

Mar 15th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. org 100h
  2.  
  3. Start:
  4. ;mov ax, 0
  5. mov si, 0
  6. mov di, 0
  7.  
  8. ;1, 5, 2, 1
  9. ;8, 2, 7, 1
  10.  
  11.  
  12. ;1, 5, 2, 1, 8, 2, 7, 3
  13. xor ax, ax ;
  14. xor dx, dx
  15. xor si, si
  16. ReviewRes:
  17. movsx bx, [res + si]
  18.  
  19. inc ax
  20.  
  21. mov di, si
  22. inc di
  23.  
  24. WatchFurther:
  25. movsx cx, [res + di]
  26.  
  27. cmp bx, cx
  28. je @F
  29. jmp EndOfLoop
  30.  
  31. @@:
  32. inc dx
  33. jmp BreakInnerLoop
  34.  
  35. EndOfLoop:
  36. inc di
  37. cmp di, 8
  38. jna WatchFurther
  39.  
  40. BreakInnerLoop:
  41.  
  42. inc si
  43. cmp si, 8
  44. jne ReviewRes
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. PrintRes:
  54.  
  55. ;print ax
  56. inc dx
  57. sub ax, dx
  58.  
  59. mov bx, ax
  60. add bx, '0'
  61.  
  62. mov ah, $02
  63. mov dx, bx
  64. int 21h
  65.  
  66. mov ah, $09
  67. mov dx, pak
  68. int 21h
  69. mov ah, $08
  70. int 21h
  71.  
  72. ret
  73.  
  74.  
  75. pak db 13, 10, 'Press any key to exit...$'
  76. arr1 db 1, 5, 2, 1
  77. arr2 db 8, 2, 7, 1
  78. res db 1, 5, 2, 1, 8, 2, 8, 1
  79. ;res db 8 dup (?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement