Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- start:
- mov ah, $09
- mov dx, text
- int 21h
- mov ah, $09
- mov dx, enter_char
- int 21h
- xor si, si
- ; input char
- mov ah, $01
- mov bl, al
- int 21h
- mov di, text
- mov cx, 12
- search:
- repne scasb
- inc si
- cmp cx, 0
- jnz search
- dec si
- mov ah, $09
- mov dx, next_line
- int 21h
- mov bx, si
- add bx, '0'
- mov ah, $02
- mov dx, bx
- int 21h
- mov ah, $09
- mov dx, ans
- int 21h
- exit:
- mov ah, $09
- mov dx, pak
- int 21h
- mov ah, $08
- int 21h
- ret
- next_line db 13, 10, "$"
- enter_char db "Enter char to find string:", 13, 10, "$"
- pak db 13, 10, "Press any key to exit...$"
- text db "Hello world$"
- ans db " occurencies$"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement