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 ;res here
- xor si, si
- ReviewRes:
- movsx bx, [res + si]
- ;mov di, si
- ;inc di
- mov di, 0
- WatchFurther:
- movsx cx, [res + di]
- cmp si, di
- je Continue
- cmp bx, cx
- je BreakInnerLoop
- cmp di, 7
- je @F
- jmp Continue
- @@:
- ;cmp di, 8
- inc ax
- jmp BreakInnerLoop
- Continue:
- inc di
- cmp di, 8
- jne WatchFurther
- BreakInnerLoop:
- inc si
- cmp si, 8
- jne ReviewRes
- PrintRes:
- ;print ax
- 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 6, 5, 2, 9, 8, 2, 7, 1
- ;res db 8 dup (?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement