Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- equ db num 10
- .data
- Old db 3, 10, 15,5 ,7 ,18, 9 , 20 ,5 ,1
- New db num dup 0
- .code
- begin:
- move ax, @data
- move ds, ax
- lea bx, Old
- lea di, New
- mov ax, 0
- L1:
- mov cx, 0
- cmp al, num
- ja sof
- mov ah, al
- inc ah
- push bx
- add bx, ah
- L2:
- cmp ah, num
- jg sofL2
- mov dl, [bx]
- mov dh, [di]
- cmp dh, dl
- jl dont_count
- inc cx
- dont_count:
- inc bx
- inc ah
- jmp L2
- sofL2:
- pop bx
- mov [di], cl
- inc di
- jmp L1
- sof:
- mov ah, 4ch
- int 21h
- end begin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement