Advertisement
Guest User

Untitled

a guest
Apr 6th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 100h
  3. equ db num 10
  4. .data
  5. Old db 3, 10, 15,5 ,7 ,18, 9 , 20 ,5 ,1
  6. New db num dup 0
  7. .code
  8. begin:
  9.     move ax, @data
  10.     move ds, ax
  11.     lea bx, Old
  12.     lea di, New
  13.  
  14.     mov ax, 0
  15. L1:
  16.     mov cx, 0
  17.     cmp al, num
  18.     ja sof
  19.     mov ah, al
  20.     inc ah
  21.     push bx
  22.     add bx, ah
  23. L2:
  24.     cmp ah, num
  25.     jg sofL2
  26.    
  27.     mov dl, [bx]
  28.     mov dh, [di]
  29.  
  30.     cmp dh, dl
  31.     jl dont_count  
  32.     inc cx
  33. dont_count:
  34.     inc bx
  35.     inc ah
  36.     jmp L2
  37. sofL2:
  38.     pop bx
  39.     mov [di], cl
  40.     inc di
  41.     jmp L1
  42. sof:
  43.     mov ah, 4ch
  44.     int 21h
  45. end begin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement