Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- push 2000
- mov bx, b ;?????? ?????? ??????? ??????? ???????
- mov a, bx ;? ???????????(?? ?????? ????? ???????? ? 100% ???????)
- mov bx, 0 ;????????
- tostackb: ;?????? ? ???? ?????? ??????
- push b+bx ;?????? ??????? ????
- inc bx ;??????????? ?? 2
- inc bx ;?.? ??????? (a), (b), (c) - DW
- cmp bx, 22 ;?????????, ????? ?? ?? ????? ???????(18 - ??? ??????, 20 - ??? ??????, 22 - ??? ???)
- jb tostackb ;???? ???? 22- ?????????? ?????? ? ????
- mov bx, 0 ;????? ????????
- tostackc:
- push c+bx ;??? ??-?? ?????, ?????? ?????? ??? ?
- inc bx
- inc bx
- cmp bx, 16
- jb tostackc
- mov bx, 0 ;????????
- mov di, 0 ;???? ????????(????? ?????? ??? ?????????, ??? ????????? ? ??? ????????? ? ????????: ????? ?? ?? ????? ??????? ? ??? ???)
- pop cx ;??????? ?????? ??????? ?? ?????
- mainloop:
- cmp di, 40 ;?????????, ? ??????? ? ?? ?? ????? ???????(????? ?? 2, DW)
- je popcx ;???? ????? ?? ????????? ??????? - ???? ? ?????
- mov ax, a+bx ;?????? ? ?? ??????? ??????? ??????? ?(?????? ???????????, ???????????)
- mov xa, ax ;?????
- mov xb, cx ;????? 2
- ;mov cx, b+di
- cmp ax, cx ;?????????? ??????? ???? ??????? ? ? ????????? ? ?????
- je equals ; ???? ????? ???? ? ?????
- ;;;;;
- cmp a+bx, 0 ;???? ?? ??? ?? ????????, ??????? ???????? ????? ????, ? ?????????? 2 ?????? ?? ????????? -
- je call adding ;?????? ???????? ? ??????? ? ??? ???, ???? ? ?????
- afteradd:
- inc bx ;???????????, ???? ??? ?????? ?? ? ???????? ???????? ?? ????? ????
- inc bx
- cmp cx, 2000
- je end
- jmp mainloop ;?????????(????????? ???? ?? ?? ???????? ????????(???????? = 0, ??????? ??????? = 20), ???? ?? ?????????? ????????)
- popcx: ;???? ?? ???? ????? - ?????? ???? ?????? ???? ??????? ?? ?????
- mov bx, 0 ;???????? (???? ????????? ??????? ???? ??????)
- pop cx ;???????? ??? ???????
- mov di, 0 ;??????
- mov xb, cx ;?????
- jmp mainloop ;?????????
- adding proc
- mov bx, 0
- addPoint:
- push cx
- mov cx, a+bx
- mov xa, cx
- pop cx
- cmp a+bx, 0
- je zero
- inc bx
- inc bx
- jmp addPoint
- zero:
- mov xb, cx
- mov cx, xb
- mov xb, cx
- mov a+bx, cx
- mov bx, -2
- pop cx
- mov di, 0
- mov xb, cx
- adding endp
- jmp afteradd
- equals:
- mov bx, 0
- inc di
- inc di
- pop cx
- jmp mainloop
- end:
- ret
- a dw 20 dup (0)
- b dw 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- c dw 20, 2, 5, 1, 2, 7, 9, 2, 4, 5
- xa dw 0
- xb dw 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement