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]
- add bx, '0'
- mov ah, $02
- mov dx, bx
- int 21h
- mov ah, $02
- mov dx, ' '
- int 21h
- 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
- 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...$"
- nextLine db 13, 10, '$'
- array db 9, 2, 8, 8, -7, 5, 6, 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement