Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- ;mov ax, 0
- mov si, 0
- mov di, 0
- ;1, 5, 2, 1
- ;8, 2, 7, 1
- ;1, 5, 2, 1, 8, 2, 7, 3
- xor ax, ax ;
- xor dx, dx
- xor si, si
- ReviewRes:
- movsx bx, [res + si]
- inc ax
- mov di, si
- inc di
- WatchFurther:
- movsx cx, [res + di]
- cmp bx, cx
- je @F
- jmp EndOfLoop
- @@:
- inc dx
- jmp BreakInnerLoop
- EndOfLoop:
- inc di
- cmp di, 8
- jna WatchFurther
- BreakInnerLoop:
- inc si
- cmp si, 8
- jne ReviewRes
- PrintRes:
- ;print ax
- inc dx
- sub ax, dx
- mov bx, ax
- add bx, '0'
- mov ah, $02
- mov dx, bx
- int 21h
- mov ah, $09
- mov dx, pak
- int 21h
- mov ah, $08
- int 21h
- ret
- pak db 13, 10, 'Press any key to exit...$'
- arr1 db 1, 5, 2, 1
- arr2 db 8, 2, 7, 1
- res db 1, 5, 2, 1, 8, 2, 8, 1
- ;res db 8 dup (?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement