Advertisement
green1ant

var7 working

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