Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Поменять массив на А[0] = N, a[1] = n-1 и т,д.
- push arr
- push [arr]
- push [num]
- call Solver
- Solver:
- push bp
- mov bp,sp
- push si
- mov si,[bp+8]
- mov cx,[bp+6]
- mov dx,[bp+4]
- xor bx,bx
- .SolveTask:
- add si, 2
- mov [si],dx
- sub [si],bx
- inc bx
- loop .SolveTask
- pop si bp
- ret 6
- num dw -10
- arr dw 10, 1, 2, 3, 4, 5, 6, 7, 8, 5, 5
- Подсчитать количество элементов,меньших чем число
- push arr
- push word[num]
- call Solver
- Solver:
- push bp
- mov bp,sp
- push si
- mov si,[bp+6]
- mov cx,[si]
- xor ax,ax
- .Solver:
- add si,2
- mov ax,[si]
- cmp ax,[bp+4]
- jge .Met2
- inc dx
- .Met2:
- loop .Solver
- pop si bp
- ret 4
- arr: db 5, -11,2,-3,4,-15
- num: dw -6
- Сумма четных
- push arr
- call Solver
- Solver:
- push bp
- mov bp,sp
- push si
- mov si,[bp+4]
- mov cx,[si]
- xor ax,ax
- .SolveTask:
- add si,2
- test byte[si],00000001b
- jne .Skip
- add al,byte[si]
- .Skip:
- loop .SolveTask
- pop si bp
- ret 2
- arr db 4, 1, 2, 4, 2
- Дана С-строка найти длину
- push str1
- call Solver
- Solver:
- push bp
- mov bp,sp
- push si
- mov si,[bp+4]
- xor ax,ax
- .SolveTask:
- cmp byte[si],0
- je .End
- inc ax
- inc si
- jmp .SolveTask
- .End:
- pop si bp
- ret 2
- str1 db 'fdhhufd',0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement