Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- mov ah, 09h
- mov dx, TestStr+1
- int 21h
- mov ah, 02h
- mov dl, [Char]
- int 21h
- mov ah, 09h
- mov dx, EndStr
- int 21h
- push TestStr
- xor ax, ax
- mov al, [Char]
- push ax
- call SearchChar
- mov ah, 02h
- mov dl, al
- add dl, '0'
- int 21h
- mov ah, 08h
- int 21h
- SearchChar:
- .prolog:
- push bp
- mov bp, sp
- .searching:
- mov di, [bp+6]
- movzx cx, byte[di]
- inc di
- mov al, [bp+4]
- repne scasb
- test cx, cx
- jz .notFound
- mov si, [bp+6]
- inc si
- sub di, si
- mov ax, di
- jmp .epilog
- .notFound:
- xor ax, ax
- .epilog:
- mov sp, bp
- pop bp
- ret 4
- TestStr db 8, "aasdasda"
- EndStr db 13, 10, '$'
- Char db 'q'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement