Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- Greeting:
- mov ah, $09
- mov dx, greeting
- int 21h
- xor si, si
- PrintArrayLoop:
- xor bx, bx
- movsx bx, [array + si]
- cmp bx, 0
- jl PrintNegative
- PrintPositive:
- ;--------------
- add bx, '0'
- mov ah, $02
- mov dx, bx
- int 21h
- mov ah, $02
- mov dx, ' '
- int 21h
- jmp Skip
- ;--------------
- PrintNegative:
- ;--------------
- mov ah, $02
- mov dx, '-'
- int 21h
- neg bx
- add bx, '0'
- mov ah, $02
- mov dx, bx
- int 21h
- mov ah, $02
- mov dx, ' '
- int 21h
- ;--------------
- Skip:
- inc si
- cmp si, 8
- jb PrintArrayLoop
- xor si, si
- xor cx, cx
- CalculateAnswer:
- xor bx, bx
- movsx bx, [array + si]
- cmp bx, 5
- jng Continue
- inc cx
- Continue:
- inc si
- cmp si, 8
- jb CalculateAnswer
- ShowAnswer:
- mov ah, $09
- mov dx, nextLine
- int 21h
- add cx, '0'
- mov ah, $02
- mov dx, cx
- int 21h
- mov ah, $02
- mov dx, ' '
- int 21h
- mov [pattern + 12], cl
- mov ah, $09
- ;mov bx, cx
- mov dx, pattern
- int 21h
- Exit:
- mov ah, $09
- mov dx, pak
- int 21h
- mov ah, $08
- int 21h
- ret
- greeting db "Enter amoumnt of elements", 13, 10, "$"
- pak db 13, 10, "Press any key to continue...$"
- pattern db 13, 10, "There are numbers > 5", 13, 10, "$"
- nextLine db 13, 10, '$'
- array db 9, -7, -1, 8, 7, 5, 6, 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement